diff options
author | Nick Mainsbridge <beatroute@iprimus.com.au> | 2008-10-11 00:04:33 +0000 |
---|---|---|
committer | Nick Mainsbridge <beatroute@iprimus.com.au> | 2008-10-11 00:04:33 +0000 |
commit | e17e94e55f481e3aff1e601aff914f7f983af8d0 (patch) | |
tree | e6d1469281e81c0e44496b2d37c68a86f79b95ea /gtk2_ardour | |
parent | f31179a49085f9d3cb4137c1f5e4bd94429006b7 (diff) |
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.h | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 34 | ||||
-rw-r--r-- | gtk2_ardour/editor_route_list.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/editor_rulers.cc | 15 |
4 files changed, 39 insertions, 20 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index e21996621e..d72c60b174 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -326,6 +326,9 @@ class Editor : public PublicEditor void toggle_measure_visibility (); void toggle_logo_visibility (); + double physical_screen_width; + double physical_screen_height; + /* SMPTE timecode & video sync */ void smpte_fps_chosen (ARDOUR::SmpteFormat format); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 6e556ba506..8ba423837d 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -113,6 +113,14 @@ Editor::initialize_canvas () track_canvas->set_center_scroll_region (false); 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 */ Pango::FontDescription* font = get_font_for_style (N_("VerboseCanvasCursor")); @@ -157,32 +165,32 @@ Editor::initialize_canvas () /* el barrio */ 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_pixels() = 1; 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_pixels() = 1; 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_pixels() = 1; 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_pixels() = 1; 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_pixels() = 1; 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_pixels() = 1; @@ -306,8 +314,6 @@ Editor::track_canvas_size_allocated () canvas_width = canvas_allocation.get_width(); canvas_height = canvas_allocation.get_height(); - full_canvas_height = canvas_height; - if (session) { TrackViewList::iterator i; double height = 0; @@ -316,6 +322,7 @@ Editor::track_canvas_size_allocated () if ((*i)->control_parent) { height += (*i)->effective_height; } + (*i)->clip_to_viewport (); } full_canvas_height = height + canvas_timebars_vsize; @@ -348,6 +355,13 @@ Editor::track_canvas_size_allocated () redisplay_tempo (false); 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 */ @@ -375,12 +389,12 @@ Editor::controls_layout_size_request (Requisition* req) if (!screen) { 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()); /* 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)) { changed = true; diff --git a/gtk2_ardour/editor_route_list.cc b/gtk2_ardour/editor_route_list.cc index ea12f4b319..d778196ac3 100644 --- a/gtk2_ardour/editor_route_list.cc +++ b/gtk2_ardour/editor_route_list.cc @@ -354,15 +354,14 @@ Editor::redisplay_route_list () } - full_canvas_height = position; - - vertical_adjustment.set_upper (position + canvas_timebars_vsize); + full_canvas_height = position + canvas_timebars_vsize; + vertical_adjustment.set_upper (full_canvas_height); 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 (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) { diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 3674ce3c90..6f7b51f916 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -787,21 +787,24 @@ Editor::update_ruler_visibility () gdouble old_canvas_timebars_vsize = canvas_timebars_vsize; canvas_timebars_vsize = (timebar_height * visible_timebars) - 1; 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 we're at the bottom of the canvas, don't move the _trackview_grooup*/ - vertical_adjustment.set_upper(vertical_adjustment.get_upper() + vertical_pos_delta); + 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_group*/ + vertical_adjustment.set_value (full_canvas_height - canvas_height + 1); } else { - vertical_adjustment.set_upper(vertical_adjustment.get_upper() + vertical_pos_delta); - _trackview_group->move (0, vertical_pos_delta); + _trackview_group->property_y () = - get_trackview_group_vertical_offset (); + _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)); time_canvas_vbox.set_size_request (-1,-1); time_canvas_event_box.queue_resize(); compute_fixed_ruler_scale(); update_fixed_rulers(); -// redisplay_tempo (false); time_canvas_event_box.show_all(); ruler_label_event_box.show_all(); |