From 378ea3430ff5cb8131ebbd93c8126ba6c46416f0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 4 May 2011 12:26:32 +0000 Subject: [PATCH] Don't alter horizontal padding when shrinking tracks to their minimum height (part of #4014). git-svn-id: svn://localhost/ardour2/branches/3.0@9472 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/route_time_axis.cc | 8 ++++---- gtk2_ardour/time_axis_view.cc | 12 ++++++++++-- gtk2_ardour/time_axis_view.h | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 497803adff..4ed5a9584c 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -866,7 +866,7 @@ RouteTimeAxisView::set_height (uint32_t h) if (height >= preset_height (HeightNormal)) { - controls_table.set_border_width (2); + _controls_padding_table.set_row_spacings (2); reset_meter(); @@ -889,8 +889,8 @@ RouteTimeAxisView::set_height (uint32_t h) } else if (height >= preset_height (HeightSmaller)) { - controls_table.set_border_width (2); - + _controls_padding_table.set_row_spacings (2); + reset_meter(); gm.get_gain_slider().hide(); @@ -912,7 +912,7 @@ RouteTimeAxisView::set_height (uint32_t h) } else { - controls_table.set_border_width (0); + _controls_padding_table.set_row_spacings (0); } diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 380b4b4c56..8f47c7745e 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -75,6 +75,7 @@ PBD::Signal1 TimeAxisView::CatchDeletion; TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/) : AxisView (sess) , controls_table (2, 8) + , _controls_padding_table (3, 3) , _size_menu (0) , _y_position (0) , _editor (ed) @@ -134,7 +135,6 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie name_hbox.show (); controls_table.set_size_request (200); - controls_table.set_border_width (2); controls_table.set_row_spacings (0); controls_table.set_col_spacings (0); controls_table.set_homogeneous (true); @@ -161,7 +161,15 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie HSeparator* separator = manage (new HSeparator()); - controls_vbox.pack_start (controls_table, false, false); + /* Use a rather hacky extra table so that we can control the space above/below and + * left/right of the controls_table separately. This in turn is so that we can + * shrink the vertical space when the track is at its minimum height. + */ + _controls_padding_table.set_row_spacings (2); + _controls_padding_table.set_col_spacings (0); + _controls_padding_table.attach (controls_table, 1, 2, 1, 2); + + controls_vbox.pack_start (_controls_padding_table, false, false); controls_vbox.pack_end (resizer_box, false, false); controls_vbox.show (); diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 6fd6865485..92835fb59e 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -219,6 +219,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful /* The Standard LHS Controls */ Gtk::HBox controls_hbox; Gtk::Table controls_table; + Gtk::Table _controls_padding_table; Gtk::EventBox controls_ebox; Gtk::VBox controls_vbox; Gtk::VBox time_axis_vbox;