simplify time-axis packing: consistent table layout

This commit is contained in:
Robin Gareus 2014-08-31 07:11:24 +02:00
parent 36c4704df9
commit 9c59b21bb6
4 changed files with 48 additions and 51 deletions

View file

@ -157,8 +157,8 @@ AutomationTimeAxisView::AutomationTimeAxisView (
}
name_label.set_text (_name);
name_label.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
name_label.set_name (X_("TrackParameterName"));
name_label.set_alignment (Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
name_label.set_name (X_("TrackParameterName"));
name_label.set_ellipsize (Pango::ELLIPSIZE_END);
string tipname = nomparent;
@ -169,16 +169,19 @@ AutomationTimeAxisView::AutomationTimeAxisView (
ARDOUR_UI::instance()->set_tip(controls_ebox, tipname);
/* add the buttons */
controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (name_label, 0, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (auto_button, 6, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.remove (name_hbox);
controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK);
controls_table.attach (name_label, 1, 3, 1, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 2, 0);
controls_table.attach (auto_button, 3, 4, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
controls_table.set_border_width (0);
name_label.show ();
hide_button.show ();
if (_controller) {
_controller.get()->set_size_request(-1, 24);
/* add bar controller */
controls_table.attach (*_controller.get(), 1, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (*_controller.get(), 1, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
/* note that this handler connects *before* the default handler */
_controller->event_widget().signal_scroll_event().connect (mem_fun (*this, &AutomationTimeAxisView::controls_ebox_scroll), false);
}
@ -424,11 +427,13 @@ AutomationTimeAxisView::set_height (uint32_t h)
if (h >= preset_height (HeightNormal)) {
auto_button.show();
hide_button.show_all();
name_label.show();
hide_button.show();
} else if (h >= preset_height (HeightSmall)) {
controls_table.hide_all ();
auto_button.hide();
name_label.hide();
}
}