summaryrefslogtreecommitdiff
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
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
-rw-r--r--gtk2_ardour/editor.cc8
-rw-r--r--gtk2_ardour/editor.h6
-rw-r--r--gtk2_ardour/editor_actions.cc2
-rw-r--r--gtk2_ardour/editor_canvas.cc69
-rw-r--r--gtk2_ardour/editor_routes.cc3
5 files changed, 33 insertions, 55 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 931196115f..f7c48daf3b 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -485,7 +485,6 @@ Editor::Editor ()
controls_layout.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
controls_layout.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::edit_controls_button_release));
- controls_layout_size_request_connection = controls_layout.signal_size_request().connect (sigc::mem_fun (*this, &Editor::controls_layout_size_request));
_cursors = new MouseCursors;
@@ -2107,9 +2106,9 @@ Editor::set_state (const XMLNode& node, int /*version*/)
}
}
- set_default_size (g.base_width, g.base_height);
+ //set_default_size (g.base_width, g.base_height);
move (x, y);
-
+
if (_session && (prop = node.property ("playhead"))) {
framepos_t pos;
sscanf (prop->value().c_str(), "%" PRIi64, &pos);
@@ -4849,6 +4848,8 @@ Editor::handle_new_route (RouteList& routes)
RouteTimeAxisView *rtv;
list<RouteTimeAxisView*> new_views;
+ cerr << "Handle new route\n";
+
for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
boost::shared_ptr<Route> route = (*x);
@@ -5473,3 +5474,4 @@ Editor::notebook_tab_clicked (GdkEventButton* ev, Gtk::Widget* page)
return true;
}
+
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index aca4015083..f16ca7872a 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -934,11 +934,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
Gtk::Table edit_packer;
Gtk::Adjustment vertical_adjustment;
-
+
Gtk::Layout controls_layout;
bool control_layout_scroll (GdkEventScroll* ev);
- void controls_layout_size_request (Gtk::Requisition*);
- sigc::connection controls_layout_size_request_connection;
+ void reset_controls_layout_width ();
+ void reset_controls_layout_height (int32_t height);
bool horizontal_scroll_left_press ();
void horizontal_scroll_left_release ();
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 3d94fd10b3..6f1579bb5a 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -1236,6 +1236,8 @@ Editor::parameter_changed (std::string p)
_group_tabs->hide ();
}
+ reset_controls_layout_width ();
+
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
if (act) {
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
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*/)
{
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index bc432990de..8ea152ba54 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -446,12 +446,15 @@ EditorRoutes::redisplay ()
n++;
}
+
/* whenever we go idle, update the track view list to reflect the new order.
we can't do this here, because we could mess up something that is traversing
the track order and has caused a redisplay of the list.
*/
Glib::signal_idle().connect (sigc::mem_fun (*_editor, &Editor::sync_track_view_list_and_routes));
+ _editor->reset_controls_layout_height (position);
+ _editor->reset_controls_layout_width ();
_editor->full_canvas_height = position + _editor->canvas_timebars_vsize;
_editor->vertical_adjustment.set_upper (_editor->full_canvas_height);