quick mockup of indented automation-track headers
authorRobin Gareus <robin@gareus.org>
Wed, 3 Sep 2014 13:03:35 +0000 (15:03 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 3 Sep 2014 13:03:35 +0000 (15:03 +0200)
XXX: If we keep this approach, TimeAxisView::show_at()
needs to be fixed.
TimeAxisView::_canvas_display should draw the separator
line at the top, and regions inside moved down 1px.

gtk2_ardour/automation_time_axis.cc
gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view.h

index 244472dc5674565506a496b6610539f830b8097b..50d82c26f98809948c76e6dd26e4d29644568d1e 100644 (file)
@@ -172,19 +172,42 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        /* add the buttons */
        controls_table.remove (name_hbox);
        if (ARDOUR::Profile->get_mixbus()) {
-               controls_table.attach (hide_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
+               controls_table.attach (hide_button, 1, 2, 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 (hide_button, 1, 2, 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);
+       controls_table.attach (name_label,  2, 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, 1, 0);
+
+       Gtk::DrawingArea *blank = manage(new Gtk::DrawingArea());
+       RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&parent);
+       if (rtv && rtv->is_audio_track()) {
+               blank->set_name("AudioTrackControlsBaseUnselected");
+       }
+       else if (rtv && rtv->is_midi_track()) {
+               blank->set_name("MidiTrackControlsBaseUnselected");
+       }
+       else {
+               blank->set_name("AudioBusControlsBaseUnselected");
+       }
+       blank->set_size_request(20, -1);
+       blank->show();
+       time_axis_hbox.pack_start (*blank, false, false);
+       time_axis_hbox.reorder_child (*blank, 0);
+
+       VSeparator* separator = manage (new VSeparator());
+       separator->set_name("TrackSeparator");
+       separator->set_size_request(1, -1);
+       separator->show();
+       time_axis_hbox.pack_start (*separator, false, false);
+       time_axis_hbox.reorder_child (*separator, 1);
 
        name_label.show ();
        hide_button.show ();
 
        if (_controller) {
                /* add bar controller */
-               controls_table.attach (*_controller.get(), 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0);
+               controls_table.attach (*_controller.get(), 2, 4, 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 13b0546d46ff4d1febd18abe2f22e0c8b3780d01..673488acb5344580dd786718f3d9585bfef48420 100644 (file)
@@ -184,9 +184,11 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
        separator->set_size_request(-1, 1);
        separator->show();
 
+       time_axis_vbox.pack_start (*separator, false, false);
        time_axis_vbox.pack_start (time_axis_frame, true, true);
-       time_axis_vbox.pack_end (*separator, false, false);
        time_axis_vbox.show();
+       time_axis_hbox.pack_start (time_axis_vbox, true, true);
+       time_axis_hbox.show();
 
        ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
 
@@ -236,7 +238,7 @@ TimeAxisView::hide ()
        _canvas_display->hide ();
 
        if (control_parent) {
-               control_parent->remove (time_axis_vbox);
+               control_parent->remove (time_axis_hbox);
                control_parent = 0;
        }
 
@@ -268,17 +270,19 @@ guint32
 TimeAxisView::show_at (double y, int& nth, VBox *parent)
 {
        if (control_parent) {
-               control_parent->reorder_child (time_axis_vbox, nth);
+               control_parent->reorder_child (time_axis_hbox, nth);
        } else {
                control_parent = parent;
-               parent->pack_start (time_axis_vbox, false, false);
-               parent->reorder_child (time_axis_vbox, nth);
+               parent->pack_start (time_axis_hbox, false, false);
+               parent->reorder_child (time_axis_hbox, nth);
        }
 
        _order = nth;
 
        if (_y_position != y) {
-               _canvas_display->set_y_position (y);
+               // XXX +1 is a quick hack to align the track-header with the canvas
+               // with the separator line at the top.
+               _canvas_display->set_y_position (y + 1);
                _y_position = y;
 
        }
@@ -530,7 +534,7 @@ TimeAxisView::set_height (uint32_t h)
                h = preset_height (HeightSmall);
        }
 
-       time_axis_vbox.property_height_request () = h;
+       time_axis_hbox.property_height_request () = h;
        height = h;
 
        char buf[32];
index bfdcf9f4f114c3c9f73ea4e2bd87c6da9cfbbc73..d14686b4ee19975dc06eeb8d71c9229b4f899ca9 100644 (file)
@@ -208,6 +208,7 @@ class TimeAxisView : public virtual AxisView
        Gtk::EventBox          controls_ebox;
        Gtk::VBox              controls_vbox;
        Gtk::VBox              time_axis_vbox;
+       Gtk::HBox              time_axis_hbox;
        Gtk::Frame             time_axis_frame;
        Gtk::HBox              name_hbox;
        Gtk::HBox              top_hbox;