summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2016-12-18 13:29:19 -0600
committerBen Loftis <ben@harrisonconsoles.com>2016-12-18 13:34:15 -0600
commitab374916141e9359d31c6bc2a8270ca8e848092e (patch)
treebfced41b53eb84880d53e372fe7446ef65d6ff8d /gtk2_ardour
parent0a5236266d54f95952b85563fb2c857d0da5bc4c (diff)
repack widgets, and add some spacer elements
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.h2
-rw-r--r--gtk2_ardour/ardour_ui2.cc87
-rw-r--r--gtk2_ardour/editor.cc73
-rw-r--r--gtk2_ardour/editor.h2
4 files changed, 125 insertions, 39 deletions
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 33dd9edf3a..a8ee9dd30f 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -380,6 +380,8 @@ public:
ARDOUR::PresentationInfo::order_t translate_order (RouteDialogs::InsertAt);
+ bool spacer_expose (GdkEventExpose*);
+
protected:
friend class PublicEditor;
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index f33df95ebe..4f9b48a2b3 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -180,8 +180,21 @@ bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult resu
}
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 */
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 3757e3a5e1..73245945d5 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -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
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 0b692c3ff2..ee963abc42 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -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();