repack widgets, and add some spacer elements
authorBen Loftis <ben@harrisonconsoles.com>
Sun, 18 Dec 2016 19:29:19 +0000 (13:29 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Sun, 18 Dec 2016 19:34:15 +0000 (13:34 -0600)
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui2.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h

index 33dd9edf3a96c8a5e32ba532a188981101ee319b..a8ee9dd30f81aa292d275be261936be7ff40c78a 100644 (file)
@@ -380,6 +380,8 @@ public:
 
        ARDOUR::PresentationInfo::order_t translate_order (RouteDialogs::InsertAt);
 
+       bool spacer_expose (GdkEventExpose*);
+
 protected:
        friend class PublicEditor;
 
index f33df95ebe1c72b1a3a09db2ccac765c0e7641ee..4f9b48a2b3d570313b5de6fc85685006e8251efd 100644 (file)
@@ -179,9 +179,22 @@ bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult resu
        return false;
 }
 
+bool
+ARDOUR_UI::spacer_expose (GdkEventExpose* ev)
+{
+       cairo_t *cr = gdk_cairo_create (ev->window);
+    
+       cairo_rectangle (cr, 1, 0, ev->area.width-2, ev->area.height);
+       cairo_set_source_rgb (cr, 0,0,0);
+       cairo_fill (cr);
+       
+       return true;
+}
+
 bool
 ARDOUR_UI::transport_expose (GdkEventExpose* ev)
 {
+return false;
        int x0, y0;
        Gtk::Widget* window_parent;
        Glib::RefPtr<Gdk::Window> win = Gtkmm2ext::window_to_draw_on (transport_table, &window_parent);
@@ -345,8 +358,8 @@ ARDOUR_UI::setup_transport ()
        punch_out_button.set_text (_("Out"));
        layered_button.set_text (_("Non-Layered"));
 
-       punch_label.set_text (_(" Punch:"));
-       layered_label.set_text (_(" Mode:"));
+       punch_label.set_text (_("Punch:"));
+       layered_label.set_text (_("Rec:"));
 
        /* and tooltips */
 
@@ -462,42 +475,70 @@ ARDOUR_UI::setup_transport ()
        transport_table.attach (sync_button, 0, 1, 1, 2 , FILL, SHRINK, 0, 0);
        transport_table.attach (*shuttle_box, 1, 2, 1, 2 , FILL, SHRINK, 3, 0);
 
-       transport_table.attach (punch_label, 2, 3, 0, 1 , FILL, SHRINK, 3, 0);
-       transport_table.attach (layered_label, 2, 3, 1, 2 , FILL, SHRINK, 3, 0);
+       //spacer
+       EventBox *spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
+       spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false);  spacer->show();
+       transport_table.attach (*spacer, 2, 3, 0, 2 , FILL, SHRINK, 3, 0);
+       
+       transport_table.attach (punch_label, 3, 4, 0, 1 , FILL, SHRINK, 3, 0);
+       transport_table.attach (layered_label, 3, 4, 1, 2 , FILL, SHRINK, 3, 0);
 
-       transport_table.attach (punch_in_button, 3, 4, 0, 1 , FILL, SHRINK, 0, 2);
-       transport_table.attach (punch_out_button, 5, 6, 0, 1 , FILL, SHRINK, 0, 2);
-       transport_table.attach (layered_button, 3, 6, 1, 2 , FILL, SHRINK, 0, 2);
+       transport_table.attach (punch_in_button, 4, 5, 0, 1 , FILL, SHRINK, 0, 2);
+       transport_table.attach (punch_out_button, 6, 7, 0, 1 , FILL, SHRINK, 0, 2);
+       transport_table.attach (layered_button, 4, 7, 1, 2 , FILL, SHRINK, 0, 2);
 
-       // some extra space here (accomodate for the record-option box)
-       transport_table.attach (*(manage (new Label (""))), 6, 7, 0, 2 , FILL, SHRINK, 2, 0);
+       //spacer
+       spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
+       spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false);  spacer->show();
+       transport_table.attach (*spacer, 7, 8, 0, 2 , FILL, SHRINK, 3, 0);
 
-       transport_table.attach (follow_edits_button, 7, 8, 0, 1 , FILL, SHRINK, 2, 0);
-       transport_table.attach (auto_return_button, 7, 8, 1, 2 , FILL, SHRINK, 2, 0);
+       transport_table.attach (follow_edits_button, 8, 9, 0, 1 , FILL, SHRINK, 2, 0);
+       transport_table.attach (auto_return_button, 8, 9, 1, 2 , FILL, SHRINK, 2, 0);
 
-       transport_table.attach (*primary_clock, 8, 10, 0, 1 , FILL, SHRINK, 2, 0);
-       transport_table.attach (*primary_clock->left_btn(), 8, 9, 1, 2 , FILL, SHRINK, 2, 0);
-       transport_table.attach (*primary_clock->right_btn(), 9, 10, 1, 2 , FILL, SHRINK, 2, 0);
+       //spacer
+       spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
+       spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false);  spacer->show();
+       transport_table.attach (*spacer, 9, 10, 0, 2 , FILL, SHRINK, 3, 0);
+
+       transport_table.attach (*primary_clock, 10, 12, 0, 1 , FILL, SHRINK, 2, 0);
+       transport_table.attach (*primary_clock->left_btn(), 10, 11, 1, 2 , FILL, SHRINK, 2, 0);
+       transport_table.attach (*primary_clock->right_btn(), 11, 12, 1, 2 , FILL, SHRINK, 2, 0);
+
+       //spacer
+       spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
+       spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false);  spacer->show();
+       transport_table.attach (*spacer, 12, 13, 0, 2 , FILL, SHRINK, 3, 0);
 
        if (!ARDOUR::Profile->get_small_screen()) {
-               transport_table.attach (*secondary_clock, 10, 12, 0, 1 , FILL, SHRINK, 2, 0);
-               transport_table.attach (*secondary_clock->left_btn(), 10, 11, 1, 2 , FILL, SHRINK, 2, 0);
-               transport_table.attach (*secondary_clock->right_btn(), 11, 12, 1, 2 , FILL, SHRINK, 2, 0);
+               transport_table.attach (*secondary_clock, 13, 15, 0, 1 , FILL, SHRINK, 2, 0);
+               transport_table.attach (*secondary_clock->left_btn(), 13, 14, 1, 2 , FILL, SHRINK, 2, 0);
+               transport_table.attach (*secondary_clock->right_btn(), 14, 15, 1, 2 , FILL, SHRINK, 2, 0);
        }
 
-       transport_table.attach (*alert_box, 12, 13, 0, 2, SHRINK, EXPAND|FILL, 2, 0);
+       //spacer
+       spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
+       spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false);  spacer->show();
+       transport_table.attach (*spacer, 15, 16, 0, 2 , FILL, SHRINK, 3, 0);
+
+       transport_table.attach (*alert_box, 16, 17, 0, 2, SHRINK, EXPAND|FILL, 2, 0);
+
+       //spacer
+       spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
+       spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false);  spacer->show();
+       transport_table.attach (*spacer, 17, 18, 0, 2 , FILL, SHRINK, 3, 0);
+
 
        /* editor-meter is in transport_hbox */
        transport_hbox.set_spacing (PX_SCALE(1));
-       transport_table.attach (transport_hbox, 13, 14, 0, 2, SHRINK, EXPAND|FILL, 2, 0);
+       transport_table.attach (transport_hbox, 18, 19, 0, 2, SHRINK, EXPAND|FILL, 2, 0);
 
-       transport_table.attach (*mini_timeline, 14, 15, 0, 2, EXPAND|FILL, EXPAND|FILL, 1, 0);
+       transport_table.attach (*mini_timeline, 19, 20, 0, 2, EXPAND|FILL, EXPAND|FILL, 1, 0);
 
        /* lua script action buttons */
-       transport_table.attach (action_script_table, 15, 16, 0, 2, SHRINK, EXPAND|FILL, 1, 0);
+       transport_table.attach (action_script_table, 20, 21, 0, 2, SHRINK, EXPAND|FILL, 1, 0);
 
-       transport_table.attach (editor_visibility_button, 16, 17, 0, 1 , FILL, SHRINK, 2, 0);
-       transport_table.attach (mixer_visibility_button, 16, 17, 1, 2 , FILL, SHRINK, 2, 0);
+       transport_table.attach (editor_visibility_button, 21, 22, 0, 1 , FILL, SHRINK, 2, 0);
+       transport_table.attach (mixer_visibility_button, 21, 22, 1, 2 , FILL, SHRINK, 2, 0);
 
        /* desensitize */
 
index 3757e3a5e11f4c70e0f7105a98d377c4b7603bbd..73245945d5b383b742fa7db9376c2fe25d380513 100644 (file)
@@ -757,6 +757,12 @@ Editor::Editor ()
 
        global_vpacker.set_spacing (2);
        global_vpacker.set_border_width (0);
+
+       //spacer
+       EventBox *spacer = manage (new EventBox ()); spacer->set_size_request(-1, 1);
+       spacer->signal_expose_event().connect (sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::spacer_expose), false);  spacer->show();
+       global_vpacker.pack_start (*spacer, false, false, 0);
+
        global_vpacker.pack_start (toolbar_hbox, false, false);
        global_vpacker.pack_start (edit_pane, true, true);
        global_hpacker.pack_start (global_vpacker, true, true);
@@ -3110,6 +3116,9 @@ Editor::setup_toolbar ()
        }
 
        /* Track zoom buttons */
+       _track_box.set_spacing (2);
+       _track_box.set_border_width (2);
+
        visible_tracks_selector.set_name ("zoom button");
        if (Profile->get_mixbus()) {
                visible_tracks_selector.set_image(::get_icon ("tav_exp"));
@@ -3129,14 +3138,14 @@ Editor::setup_toolbar ()
        tav_shrink_button.set_related_action (act);
 
        if (ARDOUR::Profile->get_mixbus()) {
-               _zoom_box.pack_start (visible_tracks_selector);
+               _track_box.pack_start (visible_tracks_selector);
        } else if (ARDOUR::Profile->get_trx()) {
-               _zoom_box.pack_start (tav_shrink_button);
-               _zoom_box.pack_start (tav_expand_button);
+               _track_box.pack_start (tav_shrink_button);
+               _track_box.pack_start (tav_expand_button);
        } else {
-               _zoom_box.pack_start (visible_tracks_selector);
-               _zoom_box.pack_start (tav_shrink_button);
-               _zoom_box.pack_start (tav_expand_button);
+               _track_box.pack_start (visible_tracks_selector);
+               _track_box.pack_start (tav_shrink_button);
+               _track_box.pack_start (tav_expand_button);
        }
 
        snap_box.set_spacing (2);
@@ -3150,7 +3159,13 @@ Editor::setup_toolbar ()
 
        snap_box.pack_start (snap_mode_selector, false, false);
        snap_box.pack_start (snap_type_selector, false, false);
-       snap_box.pack_start (edit_point_selector, false, false);
+
+       /* Edit Point*/
+       HBox *ep_box = manage (new HBox);
+       ep_box->set_spacing (2);
+       ep_box->set_border_width (2);
+
+       ep_box->pack_start (edit_point_selector, false, false);
 
        /* Nudge */
 
@@ -3168,24 +3183,50 @@ Editor::setup_toolbar ()
 
        /* Pack everything in... */
 
-       HBox* hbox = manage (new HBox);
-       hbox->set_spacing(2);
-
        toolbar_hbox.set_spacing (2);
        toolbar_hbox.set_border_width (2);
 
        toolbar_hbox.pack_start (*mode_box, false, false);
+
        if (!ARDOUR::Profile->get_trx()) {
+
+               //spacer
+               EventBox *spacer = manage (new EventBox ()); spacer->set_size_request(3, 12);
+               spacer->signal_expose_event().connect (sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::spacer_expose), false);  spacer->show();
+               toolbar_hbox.pack_start (*spacer, false, false, 3);
+
                toolbar_hbox.pack_start (_zoom_box, false, false);
-               toolbar_hbox.pack_start (*hbox, false, false);
-       }
 
-       if (!ARDOUR::Profile->get_trx()) {
-               hbox->pack_start (snap_box, false, false);
-               hbox->pack_start (*nudge_box, false, false);
+               //spacer
+               spacer = manage (new EventBox ()); spacer->set_size_request(3, 12);
+               spacer->signal_expose_event().connect (sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::spacer_expose), false);  spacer->show();
+               toolbar_hbox.pack_start (*spacer, false, false, 3);
+
+               toolbar_hbox.pack_start (_track_box, false, false);
+
+               //spacer
+               spacer = manage (new EventBox ()); spacer->set_size_request(3, 12);
+               spacer->signal_expose_event().connect (sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::spacer_expose), false);  spacer->show();
+               toolbar_hbox.pack_start (*spacer, false, false, 3);
+
+               toolbar_hbox.pack_start (snap_box, false, false);
+
+               //spacer
+               spacer = manage (new EventBox ()); spacer->set_size_request(3, 12);
+               spacer->signal_expose_event().connect (sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::spacer_expose), false);  spacer->show();
+               toolbar_hbox.pack_start (*spacer, false, false, 3);
+
+               toolbar_hbox.pack_start (*ep_box, false, false);
+
+               //spacer
+               spacer = manage (new EventBox ()); spacer->set_size_request(3, 12);
+               spacer->signal_expose_event().connect (sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::spacer_expose), false);  spacer->show();
+               toolbar_hbox.pack_start (*spacer, false, false, 3);
+
+               toolbar_hbox.pack_start (*nudge_box, false, false);
        }
 
-       hbox->show_all ();
+       toolbar_hbox.show_all ();
 }
 
 void
index 0b692c3ff2c5f93d093f703191d7131672d3a12f..ee963abc42939aee6c9344581d61d03216ec4b3c 100644 (file)
@@ -1814,6 +1814,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
 
+       Gtk::HBox           _track_box;
+
        Gtk::HBox           _zoom_box;
        void                zoom_adjustment_changed();