diff options
author | Nick Mainsbridge <beatroute@iprimus.com.au> | 2008-09-14 10:08:57 +0000 |
---|---|---|
committer | Nick Mainsbridge <beatroute@iprimus.com.au> | 2008-09-14 10:08:57 +0000 |
commit | f1ef1b0069d7fb75a4ec0391823b0230dcb2abfe (patch) | |
tree | 0635683f9c56e7f04bb09ac014d9e370c3346bd2 /gtk2_ardour/editor_canvas.cc | |
parent | 4489fc159f522eb3f9b9bdf668df853d54ed4782 (diff) |
Speed up track resizing, fix disappearing automation controls when automation track has been made minimum size.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3722 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index d5231933ec..969970365a 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -390,32 +390,30 @@ Editor::controls_layout_size_request (Requisition* req) screen = Gdk::Screen::get_default(); } - edit_controls_vbox.check_resize(); - req->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 */ - - req->width = min (req->width, screen->get_width() - 300); - req->height = min ((gint) pos, (screen->get_height() - 400)); - /* this one is important: it determines how big the layout thinks it really is, as - opposed to what it displays on the screen - */ - - controls_layout.set_size (edit_controls_vbox.get_width(), (gint) pos); - controls_layout.set_size_request(edit_controls_vbox.get_width(), -1); - zoom_box.set_size_request(edit_controls_vbox.get_width(), -1); - time_button_event_box.set_size_request(edit_controls_vbox.get_width(), -1); - - 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. + width = min (width, screen->get_width() - 300); + + if (req->width != width) { + req->width = width; + } + + gint height = min ( (gint) pos, (screen->get_height() - 400)); + if (req->height != height) { + req->height = height; + } + + if ((width != edit_controls_vbox.get_width()) || height != pos) { + + /* this one is important: it determines how big the layout thinks it really is, as + opposed to what it displays on the screen */ - vertical_adjustment.set_upper (pos + canvas_timebars_vsize); - vertical_adjustment.set_value (pos + canvas_timebars_vsize - canvas_height); - } else { - vertical_adjustment.set_upper (pos + canvas_timebars_vsize); + controls_layout.set_size (edit_controls_vbox.get_width(), pos ); + controls_layout.set_size_request(edit_controls_vbox.get_width(), -1); + time_button_event_box.set_size_request(edit_controls_vbox.get_width(), -1); + zoom_box.set_size_request(edit_controls_vbox.get_width(), -1); } //cerr << "sizes = " << req->width << " " << edit_controls_vbox.get_width() << " " << controls_layout.get_width() << " " << zoom_box.get_width() << " " << time_button_frame.get_width() << endl;//DEBUG |