mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
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
This commit is contained in:
parent
8dde7e7f5d
commit
314f0d91d3
5 changed files with 34 additions and 56 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 w = edit_controls_vbox.get_width();
|
||||
|
||||
gint height = min ((gint) pos, (gint) (physical_screen_height(get_window()) - 600));
|
||||
if (_group_tabs->is_mapped()) {
|
||||
w += _group_tabs->get_width();
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
/* the controls layout has no horizontal scrolling, its visible
|
||||
width is always equal to the total width of its contents.
|
||||
*/
|
||||
|
||||
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 ();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
/* 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;
|
||||
|
||||
// time_button_event_box.property_width_request () = vbox_width;
|
||||
// zoom_box.property_width_request () = vbox_width;
|
||||
}
|
||||
|
||||
if (req->height != height) {
|
||||
req->height = height;
|
||||
controls_layout.property_height () = (guint) floor (pos);
|
||||
controls_layout.property_height_request () = height;
|
||||
}
|
||||
|
||||
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_width() = w;
|
||||
controls_layout.property_width_request() = w;
|
||||
}
|
||||
|
||||
void
|
||||
Editor::reset_controls_layout_height (int32_t h)
|
||||
{
|
||||
/* set the height of the scrollable area (i.e. the sum of all contained widgets)
|
||||
*/
|
||||
|
||||
controls_layout.property_height() = h;
|
||||
|
||||
/* size request is set elsewhere, see ::track_canvas_allocate() */
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::track_canvas_map_handler (GdkEventAny* /*ev*/)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue