mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
Fix the nostar ruler hiding bug, rejig ruler bars again, this time making them physical_screen_width wide - preventing artefacts while hiding.
git-svn-id: svn://localhost/ardour2/branches/3.0@3912 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
f31179a490
commit
e17e94e55f
4 changed files with 39 additions and 20 deletions
|
|
@ -326,6 +326,9 @@ class Editor : public PublicEditor
|
||||||
void toggle_measure_visibility ();
|
void toggle_measure_visibility ();
|
||||||
void toggle_logo_visibility ();
|
void toggle_logo_visibility ();
|
||||||
|
|
||||||
|
double physical_screen_width;
|
||||||
|
double physical_screen_height;
|
||||||
|
|
||||||
/* SMPTE timecode & video sync */
|
/* SMPTE timecode & video sync */
|
||||||
|
|
||||||
void smpte_fps_chosen (ARDOUR::SmpteFormat format);
|
void smpte_fps_chosen (ARDOUR::SmpteFormat format);
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,14 @@ Editor::initialize_canvas ()
|
||||||
track_canvas->set_center_scroll_region (false);
|
track_canvas->set_center_scroll_region (false);
|
||||||
track_canvas->set_dither (Gdk::RGB_DITHER_NONE);
|
track_canvas->set_dither (Gdk::RGB_DITHER_NONE);
|
||||||
|
|
||||||
|
Glib::RefPtr<Gdk::Screen> screen = get_screen();
|
||||||
|
|
||||||
|
if (!screen) {
|
||||||
|
screen = Gdk::Screen::get_default();
|
||||||
|
}
|
||||||
|
physical_screen_width = screen->get_width ();
|
||||||
|
physical_screen_height = screen->get_height ();
|
||||||
|
|
||||||
/* stuff for the verbose canvas cursor */
|
/* stuff for the verbose canvas cursor */
|
||||||
|
|
||||||
Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor"));
|
Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor"));
|
||||||
|
|
@ -157,32 +165,32 @@ Editor::initialize_canvas ()
|
||||||
/* el barrio */
|
/* el barrio */
|
||||||
|
|
||||||
meter_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
meter_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
||||||
meter_bar = new ArdourCanvas::SimpleRect (*meter_bar_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
|
meter_bar = new ArdourCanvas::SimpleRect (*meter_bar_group, 0.0, 0.0, physical_screen_width, timebar_height-1.0);
|
||||||
meter_bar->property_outline_what() = (0x1 | 0x8);
|
meter_bar->property_outline_what() = (0x1 | 0x8);
|
||||||
meter_bar->property_outline_pixels() = 1;
|
meter_bar->property_outline_pixels() = 1;
|
||||||
|
|
||||||
tempo_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
tempo_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
||||||
tempo_bar = new ArdourCanvas::SimpleRect (*tempo_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
|
tempo_bar = new ArdourCanvas::SimpleRect (*tempo_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height-1.0));
|
||||||
tempo_bar->property_outline_what() = (0x1 | 0x8);
|
tempo_bar->property_outline_what() = (0x1 | 0x8);
|
||||||
tempo_bar->property_outline_pixels() = 1;
|
tempo_bar->property_outline_pixels() = 1;
|
||||||
|
|
||||||
range_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
range_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
||||||
range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
|
range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height-1.0));
|
||||||
range_marker_bar->property_outline_what() = (0x1 | 0x8);
|
range_marker_bar->property_outline_what() = (0x1 | 0x8);
|
||||||
range_marker_bar->property_outline_pixels() = 1;
|
range_marker_bar->property_outline_pixels() = 1;
|
||||||
|
|
||||||
transport_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
transport_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
||||||
transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
|
transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height-1.0));
|
||||||
transport_marker_bar->property_outline_what() = (0x1 | 0x8);
|
transport_marker_bar->property_outline_what() = (0x1 | 0x8);
|
||||||
transport_marker_bar->property_outline_pixels() = 1;
|
transport_marker_bar->property_outline_pixels() = 1;
|
||||||
|
|
||||||
marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
||||||
marker_bar = new ArdourCanvas::SimpleRect (*marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
|
marker_bar = new ArdourCanvas::SimpleRect (*marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height-1.0));
|
||||||
marker_bar->property_outline_what() = (0x1 | 0x8);
|
marker_bar->property_outline_what() = (0x1 | 0x8);
|
||||||
marker_bar->property_outline_pixels() = 1;
|
marker_bar->property_outline_pixels() = 1;
|
||||||
|
|
||||||
cd_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
cd_marker_bar_group = new ArdourCanvas::Group (*track_canvas->root());
|
||||||
cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_bar_group, 0.0, 0.0, max_canvas_coordinate, (timebar_height-1.0));
|
cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_bar_group, 0.0, 0.0, physical_screen_width, (timebar_height-1.0));
|
||||||
cd_marker_bar->property_outline_what() = (0x1 | 0x8);
|
cd_marker_bar->property_outline_what() = (0x1 | 0x8);
|
||||||
cd_marker_bar->property_outline_pixels() = 1;
|
cd_marker_bar->property_outline_pixels() = 1;
|
||||||
|
|
||||||
|
|
@ -306,8 +314,6 @@ Editor::track_canvas_size_allocated ()
|
||||||
canvas_width = canvas_allocation.get_width();
|
canvas_width = canvas_allocation.get_width();
|
||||||
canvas_height = canvas_allocation.get_height();
|
canvas_height = canvas_allocation.get_height();
|
||||||
|
|
||||||
full_canvas_height = canvas_height;
|
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
TrackViewList::iterator i;
|
TrackViewList::iterator i;
|
||||||
double height = 0;
|
double height = 0;
|
||||||
|
|
@ -316,6 +322,7 @@ Editor::track_canvas_size_allocated ()
|
||||||
if ((*i)->control_parent) {
|
if ((*i)->control_parent) {
|
||||||
height += (*i)->effective_height;
|
height += (*i)->effective_height;
|
||||||
}
|
}
|
||||||
|
(*i)->clip_to_viewport ();
|
||||||
}
|
}
|
||||||
|
|
||||||
full_canvas_height = height + canvas_timebars_vsize;
|
full_canvas_height = height + canvas_timebars_vsize;
|
||||||
|
|
@ -348,6 +355,13 @@ Editor::track_canvas_size_allocated ()
|
||||||
redisplay_tempo (false);
|
redisplay_tempo (false);
|
||||||
|
|
||||||
last_trackview_group_vertical_offset = get_trackview_group_vertical_offset ();
|
last_trackview_group_vertical_offset = get_trackview_group_vertical_offset ();
|
||||||
|
if ((vertical_adjustment.get_value() + canvas_height) >= vertical_adjustment.get_upper()) {
|
||||||
|
/*
|
||||||
|
We're increasing the size of the canvas while the bottom is visible.
|
||||||
|
We scroll down to keep in step with the controls layout.
|
||||||
|
*/
|
||||||
|
vertical_adjustment.set_value (full_canvas_height - canvas_height + 1);
|
||||||
|
}
|
||||||
|
|
||||||
Resized (); /* EMIT_SIGNAL */
|
Resized (); /* EMIT_SIGNAL */
|
||||||
|
|
||||||
|
|
@ -375,12 +389,12 @@ Editor::controls_layout_size_request (Requisition* req)
|
||||||
if (!screen) {
|
if (!screen) {
|
||||||
screen = Gdk::Screen::get_default();
|
screen = Gdk::Screen::get_default();
|
||||||
}
|
}
|
||||||
gint height = min ( (gint) pos, (screen->get_height() - 600));
|
gint height = min ( (gint) pos, (gint) (physical_screen_height - 600));
|
||||||
gint width = max (edit_controls_vbox.get_width(), controls_layout.get_width());
|
gint width = max (edit_controls_vbox.get_width(), controls_layout.get_width());
|
||||||
|
|
||||||
/* don't get too big. the fudge factors here are just guesses */
|
/* don't get too big. the fudge factors here are just guesses */
|
||||||
|
|
||||||
width = min (width, screen->get_width() - 300);
|
width = min (width, (gint) (physical_screen_width - 300));
|
||||||
|
|
||||||
if ((req->width != width) || (req->height != height)) {
|
if ((req->width != width) || (req->height != height)) {
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
|
||||||
|
|
@ -354,15 +354,14 @@ Editor::redisplay_route_list ()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
full_canvas_height = position;
|
full_canvas_height = position + canvas_timebars_vsize;
|
||||||
|
vertical_adjustment.set_upper (full_canvas_height);
|
||||||
vertical_adjustment.set_upper (position + canvas_timebars_vsize);
|
|
||||||
if ((vertical_adjustment.get_value() + canvas_height) > vertical_adjustment.get_upper()) {
|
if ((vertical_adjustment.get_value() + canvas_height) > vertical_adjustment.get_upper()) {
|
||||||
/*
|
/*
|
||||||
We're increasing the size of the canvas while the bottom is visible.
|
We're increasing the size of the canvas while the bottom is visible.
|
||||||
We scroll down to keep in step with the controls layout.
|
We scroll down to keep in step with the controls layout.
|
||||||
*/
|
*/
|
||||||
vertical_adjustment.set_value (position + canvas_timebars_vsize - canvas_height);
|
vertical_adjustment.set_value (full_canvas_height - canvas_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config->get_sync_all_route_ordering() && !ignore_route_list_reorder) {
|
if (Config->get_sync_all_route_ordering() && !ignore_route_list_reorder) {
|
||||||
|
|
|
||||||
|
|
@ -787,21 +787,24 @@ Editor::update_ruler_visibility ()
|
||||||
gdouble old_canvas_timebars_vsize = canvas_timebars_vsize;
|
gdouble old_canvas_timebars_vsize = canvas_timebars_vsize;
|
||||||
canvas_timebars_vsize = (timebar_height * visible_timebars) - 1;
|
canvas_timebars_vsize = (timebar_height * visible_timebars) - 1;
|
||||||
gdouble vertical_pos_delta = canvas_timebars_vsize - old_canvas_timebars_vsize;
|
gdouble vertical_pos_delta = canvas_timebars_vsize - old_canvas_timebars_vsize;
|
||||||
|
vertical_adjustment.set_upper(vertical_adjustment.get_upper() + vertical_pos_delta);
|
||||||
|
full_canvas_height += vertical_pos_delta;
|
||||||
|
|
||||||
if (vertical_pos_delta < 0 && (vertical_adjustment.get_value() + canvas_height) >= vertical_adjustment.get_upper()) {
|
if (vertical_adjustment.get_value() != 0 && (vertical_adjustment.get_value() + canvas_height >= full_canvas_height)) {
|
||||||
/*if we're at the bottom of the canvas, don't move the _trackview_grooup*/
|
/*if we're at the bottom of the canvas, don't move the _trackview_group*/
|
||||||
vertical_adjustment.set_upper(vertical_adjustment.get_upper() + vertical_pos_delta);
|
vertical_adjustment.set_value (full_canvas_height - canvas_height + 1);
|
||||||
} else {
|
} else {
|
||||||
vertical_adjustment.set_upper(vertical_adjustment.get_upper() + vertical_pos_delta);
|
_trackview_group->property_y () = - get_trackview_group_vertical_offset ();
|
||||||
_trackview_group->move (0, vertical_pos_delta);
|
_trackview_group->move (0, 0);
|
||||||
|
last_trackview_group_vertical_offset = get_trackview_group_vertical_offset ();
|
||||||
}
|
}
|
||||||
|
|
||||||
ruler_label_vbox.set_size_request (-1, (int)(timebar_height * visible_rulers));
|
ruler_label_vbox.set_size_request (-1, (int)(timebar_height * visible_rulers));
|
||||||
|
|
||||||
time_canvas_vbox.set_size_request (-1,-1);
|
time_canvas_vbox.set_size_request (-1,-1);
|
||||||
time_canvas_event_box.queue_resize();
|
time_canvas_event_box.queue_resize();
|
||||||
compute_fixed_ruler_scale();
|
compute_fixed_ruler_scale();
|
||||||
update_fixed_rulers();
|
update_fixed_rulers();
|
||||||
// redisplay_tempo (false);
|
|
||||||
|
|
||||||
time_canvas_event_box.show_all();
|
time_canvas_event_box.show_all();
|
||||||
ruler_label_event_box.show_all();
|
ruler_label_event_box.show_all();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue