summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_canvas.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-01-29 14:48:59 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-01-29 14:48:59 +0000
commit314f0d91d39922b6990c28d4f2cbdaef54feee34 (patch)
treea0b9bb8643f5d849c51005c6d35e6a806030ffed /gtk2_ardour/editor_canvas.cc
parent8dde7e7f5da1c0be359b60a631154de89060f707 (diff)
a radically new approach to sizing the track header layout that now allows ardour to shrink dramatically in vertical height. current lower limit is about 763 pixels WITH the editor mixer strip, and something much, much smaller without it
git-svn-id: svn://localhost/ardour2/branches/3.0@8608 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r--gtk2_ardour/editor_canvas.cc69
1 files changed, 20 insertions, 49 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index a98f48a8a2..79469d6710 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -343,62 +343,33 @@ Editor::track_canvas_size_allocated ()
}
void
-Editor::controls_layout_size_request (Requisition* req)
+Editor::reset_controls_layout_width ()
{
- double pos = 0;
- for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
- pos += (*i)->effective_height ();
- }
-
- gint height = min ((gint) pos, (gint) (physical_screen_height(get_window()) - 600));
-
- bool changed = false;
-
- gint w = edit_controls_vbox.get_width();
- if (_group_tabs->is_mapped()) {
- w += _group_tabs->get_width ();
- }
-
- gint width = max (w, controls_layout.get_width());
-
- /* don't get too big. the fudge factors here are just guesses */
-
- width = min (width, (gint) (physical_screen_width(get_window()) - 300));
-
- if ((req->width != width) || (req->height != height)) {
- changed = true;
- controls_layout_size_request_connection.disconnect ();
- }
+ gint w = edit_controls_vbox.get_width();
- if (req->width != width) {
- gint vbox_width = edit_controls_vbox.get_width();
- if (_group_tabs->is_mapped()) {
- vbox_width += _group_tabs->get_width();
- }
- req->width = width;
+ if (_group_tabs->is_mapped()) {
+ w += _group_tabs->get_width();
+ }
- /* 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.property_width () = vbox_width;
- controls_layout.property_width_request () = vbox_width;
+ /* the controls layout has no horizontal scrolling, its visible
+ width is always equal to the total width of its contents.
+ */
- // time_button_event_box.property_width_request () = vbox_width;
- // zoom_box.property_width_request () = vbox_width;
- }
+ controls_layout.property_width() = w;
+ controls_layout.property_width_request() = w;
+}
- if (req->height != height) {
- req->height = height;
- controls_layout.property_height () = (guint) floor (pos);
- controls_layout.property_height_request () = height;
- }
+void
+Editor::reset_controls_layout_height (int32_t h)
+{
+ /* set the height of the scrollable area (i.e. the sum of all contained widgets)
+ */
- if (changed) {
- controls_layout_size_request_connection = controls_layout.signal_size_request().connect (sigc::mem_fun (*this, &Editor::controls_layout_size_request));
- }
- //cerr << "sizes = " << req->width << " " << edit_controls_vbox.get_width() << " " << controls_layout.get_width() << " " << zoom_box.get_width() << " " << time_button_frame.get_width() << endl;//DEBUG
+ controls_layout.property_height() = h;
+
+ /* size request is set elsewhere, see ::track_canvas_allocate() */
}
-
+
bool
Editor::track_canvas_map_handler (GdkEventAny* /*ev*/)
{