track-header fader tweaks:
authorRobin Gareus <robin@gareus.org>
Sun, 31 Aug 2014 19:32:22 +0000 (21:32 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 31 Aug 2014 19:32:22 +0000 (21:32 +0200)
* align height to button-height.
* align width to label text-entry
* increase min width

gtk2_ardour/automation_time_axis.cc
gtk2_ardour/route_time_axis.cc
gtk2_ardour/time_axis_view.cc
libs/gtkmm2ext/barcontroller.cc

index d92ac5c7482aae9e89b38b35d221dfa5d2b4f1cd..244472dc5674565506a496b6610539f830b8097b 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "ardour/automation_control.h"
 #include "ardour/event_type_map.h"
+#include "ardour/profile.h"
 #include "ardour/route.h"
 #include "ardour/session.h"
 
@@ -170,18 +171,20 @@ AutomationTimeAxisView::AutomationTimeAxisView (
 
        /* add the buttons */
        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);
+       if (ARDOUR::Profile->get_mixbus()) {
+               controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
+       } else {
+               controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 1, 0);
+       }
+       controls_table.attach (name_label,  1, 2, 1, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 2, 0);
+       controls_table.attach (auto_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
 
        name_label.show ();
        hide_button.show ();
 
        if (_controller) {
-               _controller.get()->set_size_request(-1, 24);
                /* add bar controller */
-               controls_table.attach (*_controller.get(), 1, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
+               controls_table.attach (*_controller.get(), 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0);
                /* note that this handler connects *before* the default handler */
                _controller->event_widget().signal_scroll_event().connect (mem_fun (*this, &AutomationTimeAxisView::controls_ebox_scroll), false);
        }
index 9eb700d658dc4db1b1f41192baa84ab935aa38e8..cc25d85719d369e3cc733cd8a04c73eed5b8dd52 100644 (file)
@@ -105,7 +105,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan
        , playlist_action_menu (0)
        , mode_menu (0)
        , color_mode_menu (0)
-       , gm (sess, true, 75, 20)
+       , gm (sess, true, 75, 14)
        , _ignore_set_layer_display (false)
 {
        number_label.set_name("route button");
@@ -252,13 +252,13 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
 
        if (ARDOUR::Profile->get_mixbus()) {
                controls_button_size_group->add_widget(route_group_button);
-               controls_table.attach (route_group_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
-               controls_table.attach (gm.get_gain_slider(), 3, 5, 2, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
+               controls_table.attach (route_group_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
+               controls_table.attach (gm.get_gain_slider(), 3, 5, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0);
        }
        else if (!ARDOUR::Profile->get_trx()) {
                controls_button_size_group->add_widget(route_group_button);
-               controls_table.attach (route_group_button, 4, 5, 3, 4, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
-               controls_table.attach (gm.get_gain_slider(), 0, 2, 2, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
+               controls_table.attach (route_group_button, 4, 5, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
+               controls_table.attach (gm.get_gain_slider(), 0, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0);
        }
        
        ARDOUR_UI::instance()->set_tip(*solo_button,_("Solo"));
@@ -275,21 +275,21 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
        label_view ();
 
        if (ARDOUR::Profile->get_mixbus()) {
-               controls_table.attach (automation_button, 1, 2, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
+               controls_table.attach (automation_button, 1, 2, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
                controls_button_size_group->add_widget(automation_button);
        }
        else if (!ARDOUR::Profile->get_trx()) {
-               controls_table.attach (automation_button, 3, 4, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
+               controls_table.attach (automation_button, 3, 4, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
                controls_button_size_group->add_widget(automation_button);
        }
 
        if (is_track() && track()->mode() == ARDOUR::Normal) {
                if (ARDOUR::Profile->get_mixbus()) {
-                       controls_table.attach (playlist_button, 0, 1, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
+                       controls_table.attach (playlist_button, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
                        controls_button_size_group->add_widget(playlist_button);
                }
                else if (!ARDOUR::Profile->get_trx()) {
-                       controls_table.attach (playlist_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
+                       controls_table.attach (playlist_button, 2, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
                        controls_button_size_group->add_widget(playlist_button);
                }
        }
@@ -425,9 +425,9 @@ RouteTimeAxisView::update_track_number_visibility ()
        }
        if (show_label) {
                if (ARDOUR::Profile->get_mixbus()) {
-                       controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
+                       controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 1, 0);
                } else {
-                       controls_table.attach (number_label, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
+                       controls_table.attach (number_label, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 1, 0);
                }
                const int tnw = std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_width_of_digit_0_to_9()
                number_label.set_size_request(3 + tnw, -1);
index 62225872d6c754b08a5e0c933221e964e13a588d..13a542ac817256d20b3cc443eda86b6498130582 100644 (file)
@@ -75,7 +75,7 @@ Glib::RefPtr<Gtk::SizeGroup> TimeAxisView::controls_meters_size_group = SizeGrou
 
 TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
        : AxisView (sess)
-       , controls_table (4, 4)
+       , controls_table (3, 3)
        , controls_button_size_group (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_BOTH))
        , _name_editing (false)
        , height (0)
@@ -131,11 +131,8 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
        name_hbox.pack_end (name_label, true, true);
 
        // set min. track-header width if fader is not visible
-       if (ARDOUR::Profile->get_mixbus() ) {
-               name_hbox.set_size_request(100, 0);
-       } else {
-               name_hbox.set_size_request(90, 0);
-       }
+       name_hbox.set_size_request(100, 0);
+
        name_hbox.show ();
        name_label.show ();
 
@@ -1116,7 +1113,7 @@ TimeAxisView::compute_heights ()
 {
        // TODO this function should be re-evaluated when font-scaling changes (!)
        Gtk::Window window (Gtk::WINDOW_TOPLEVEL);
-       Gtk::Table one_row_table (1, 8);
+       Gtk::Table one_row_table (1, 1);
        ArdourButton* test_button = manage (new ArdourButton);
        const int border_width = 2;
        const int frame_height = 2;
index 4e49e7a8874b49fa9eb7c6d43d277787d0dbffa8..2b9aba1016322555cae16e53f56c781c59e0fbc4 100644 (file)
@@ -57,7 +57,7 @@ BarController::BarController (Gtk::Adjustment& adj,
        layout = darea.create_pango_layout("");
 
        set (.5, .5, 1.0, 1.0);
-       set_border_width(2);
+       set_border_width(0);
 
        initial_value = adjustment.get_value ();