From 5b947d97a6e1c9fdbc80c3cf36b46db90f2ee305 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Mon, 6 May 2024 16:42:30 -0500 Subject: [PATCH] T: yet another approach to toolbar packing --- gtk2_ardour/ardour_ui.cc | 3 +- gtk2_ardour/ardour_ui.h | 2 + gtk2_ardour/ardour_ui_dependents.cc | 67 +++++++++++++++------------- gtk2_ardour/editor.cc | 28 +++++++----- gtk2_ardour/icons/harrison.png | Bin 1675 -> 486 bytes 5 files changed, 59 insertions(+), 41 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d611bd2470..aa1409292d 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -323,12 +323,13 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) , _editor_meter_peaked (false) , _livetrax_btn_rec_all (_("Rec All")) , _livetrax_btn_rec_none (_("Rec None")) - , _livetrax_btn_peak_reset (_("Reset Peak Hold")) + , _livetrax_btn_peak_reset (_("Reset Peaks")) , _livetrax_btn_marker_new (_("Marker")) , _livetrax_btn_prev_marker (_("<< Prev")) , _livetrax_btn_next_marker (_("Next >>")) , _livetrax_centering_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL)) , _livetrax_toolbar_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL)) + , _livetrax_viewbutton_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_BOTH)) , _numpad_locate_happening (false) , _session_is_new (false) , last_key_press_time (0) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 53d6ccec7e..cab2a4aeb6 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -643,6 +643,7 @@ private: /* LiveTrax */ Gtk::Table livetrax_top_table_l; + Gtk::Table livetrax_top_table_c; Gtk::Table livetrax_top_table_r; Gtk::Table livetrax_edit_table; Gtk::HBox livetrax_meter_bar; @@ -660,6 +661,7 @@ private: Glib::RefPtr _livetrax_centering_sizegroup; Glib::RefPtr _livetrax_toolbar_sizegroup; + Glib::RefPtr _livetrax_viewbutton_sizegroup; TimeInfoBox* livetrax_time_info_box; ArdourWidgets::ArdourButton* livetrax_multi_out_button; diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index 47e33fd0f8..3479980a91 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -409,8 +409,9 @@ ARDOUR_UI::livetrax_setup_windows () _livetrax_sections = new EditorSections(); Image* icon = manage (new Image (ARDOUR_UI_UTILS::get_icon ("harrison"))); - VBox* icon_vb = manage(new VBox()); - icon_vb->pack_start(*icon); + livetrax_top_table_c.set_border_width(4); + livetrax_top_table_c.attach(*icon, 0,1, 0,1, FILL, FILL, 4, 4 ); + livetrax_top_table_c.attach(*primary_clock, 0,1, 1,2, FILL, FILL, 4, 4 ); VBox* vb; HBox* hb; @@ -448,22 +449,22 @@ ARDOUR_UI::livetrax_setup_windows () livetrax_view_in_folder_button = manage (new ArdourButton (elements)); livetrax_view_in_folder_button->set_icon (ArdourWidgets::ArdourIcon::Folder); - livetrax_editor_view_button = manage (new ArdourButton (_("TRACKS"), ArdourButton::Element (ArdourButton::Text|ArdourButton::Edge|ArdourButton::Body), true)); + livetrax_editor_view_button = manage (new ArdourButton (_("TRACKS"), ArdourButton::Element (ArdourButton::Text|ArdourButton::Body), true)); livetrax_editor_view_button->set_icon (ArdourWidgets::ArdourIcon::TrackWaveform); act = ActionManager::get_action (X_("Common"), X_("livetrax-toggle-editor")); livetrax_editor_view_button->set_related_action (act); - livetrax_prefs_view_button = manage (new ArdourButton (_("PREFS"), ArdourButton::Element (ArdourButton::Text|ArdourButton::Edge|ArdourButton::Body), true)); + livetrax_prefs_view_button = manage (new ArdourButton (_("PREFS"), ArdourButton::Element (ArdourButton::Text|ArdourButton::Body), true)); livetrax_prefs_view_button->set_icon (ArdourWidgets::ArdourIcon::Config); act = ActionManager::get_action (X_("Common"), X_("livetrax-toggle-prefs")); livetrax_prefs_view_button->set_related_action (act); - livetrax_meter_view_button = manage (new ArdourButton (ArdourButton::Element (ArdourButton::Text|ArdourButton::Edge|ArdourButton::Body), true));; + livetrax_meter_view_button = manage (new ArdourButton (ArdourButton::Element (ArdourButton::Text|ArdourButton::Body), true));; livetrax_meter_view_button->set_icon (ArdourWidgets::ArdourIcon::Meters); act = ActionManager::get_action (X_("Common"), X_("livetrax-toggle-meter")); livetrax_meter_view_button->set_related_action (act); - livetrax_mixer_view_button = manage (new ArdourButton (ArdourButton::Element (ArdourButton::Text|ArdourButton::Edge|ArdourButton::Body), true)); + livetrax_mixer_view_button = manage (new ArdourButton (ArdourButton::Element (ArdourButton::Text|ArdourButton::Body), true)); livetrax_mixer_view_button->set_icon (ArdourWidgets::ArdourIcon::Mixer); act = ActionManager::get_action (X_("Common"), X_("livetrax-toggle-mixer")); livetrax_mixer_view_button->set_related_action (act); @@ -472,12 +473,6 @@ ARDOUR_UI::livetrax_setup_windows () act = ActionManager::get_action (X_("Window"), X_("toggle-audio-midi-setup")); livetrax_sr_button->set_related_action (act); - HBox *view_box = manage (new HBox); - view_box->set_spacing(4); - view_box->pack_start (*livetrax_meter_view_button, false, false); - view_box->pack_start (*livetrax_editor_view_button, false, false); - view_box->pack_start (*livetrax_mixer_view_button, false, false); - livetrax_lock_button = manage (new ArdourButton (elements, true)); livetrax_lock_button->set_icon (ArdourWidgets::ArdourIcon::Lock); act = ActionManager::get_action (X_("Editor"), X_("lock")); @@ -487,19 +482,15 @@ ARDOUR_UI::livetrax_setup_windows () livetrax_top_table_l.attach (_livetrax_btn_prev_marker, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); livetrax_top_table_l.attach (_livetrax_btn_marker_new, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_l.attach (_livetrax_btn_next_marker, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_l.attach (_livetrax_btn_next_marker, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4); livetrax_top_table_l.attach (transport_ctrl, TCOL, TCOL+4, 1, 2, FILL, FILL, 4, 4); TCOL+=4; - livetrax_top_table_l.attach (sync_button, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_l.attach (*primary_clock, TCOL, TCOL+2, 1, 2, FILL, FILL, 4, 4); TCOL+=2; + livetrax_top_table_l.attach (sync_button, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); TCOL++; livetrax_top_table_l.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++; - livetrax_top_table_l.attach (*ev_dsp, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_l.attach (disk_space_label, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++; - - livetrax_top_table_l.attach (*livetrax_ff_dropdown, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_l.attach (*livetrax_sr_button, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++; + livetrax_top_table_l.attach (*livetrax_ff_dropdown, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_l.attach (*livetrax_sr_button, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++; // livetrax_top_table.attach (*cw, TCOL, TCOL+1, 0, 2, FILL, FILL, 4, 4); TCOL++; @@ -508,37 +499,53 @@ ARDOUR_UI::livetrax_setup_windows () TCOL = 0; - livetrax_top_table_r.attach (*editor->mouse_mode_hbox, TCOL, TCOL+2, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_r.attach (*editor->mouse_mode_hbox, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_r.attach (editor->_track_box, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL+=2; - livetrax_top_table_r.attach (editor->_track_box, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); - livetrax_top_table_r.attach (editor->_zoom_box, TCOL+1, TCOL+2, 1, 2, FILL, FILL, 4, 4); TCOL+=2; + livetrax_top_table_r.attach (_livetrax_btn_peak_reset, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_r.attach (editor->_zoom_box, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++; livetrax_top_table_r.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++; livetrax_top_table_r.attach (_livetrax_btn_rec_all, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_r.attach (_livetrax_btn_rec_none, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_r.attach (_livetrax_btn_peak_reset, TCOL, TCOL+2, 1, 2, FILL, FILL, 4, 4); TCOL+=2; + livetrax_top_table_r.attach (_livetrax_btn_rec_none, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); TCOL+=2; - livetrax_top_table_r.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++; + livetrax_top_table_r.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++; + + livetrax_top_table_r.attach (*ev_dsp, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); + livetrax_top_table_r.attach (disk_space_label, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++; livetrax_top_table_r.attach (*livetrax_lock_button, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4); livetrax_top_table_r.attach (*livetrax_view_in_folder_button, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4); livetrax_top_table_r.attach (*livetrax_prefs_view_button, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4); - livetrax_top_table_r.attach (*view_box, TCOL, TCOL+3, 1, 2, FILL, FILL, 4, 4); TCOL+=3; + livetrax_top_table_r.attach (*livetrax_meter_view_button, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); + livetrax_top_table_r.attach (*livetrax_editor_view_button, TCOL+1, TCOL+2, 1, 2, FILL, FILL, 4, 4); + livetrax_top_table_r.attach (*livetrax_mixer_view_button, TCOL+2, TCOL+3, 1, 2, FILL, FILL, 4, 4); TCOL+=3; //left & right tables should be equal width, so the logo is centered between them _livetrax_centering_sizegroup->add_widget(livetrax_top_table_l); _livetrax_centering_sizegroup->add_widget(livetrax_top_table_r); - //force some toolbar widget's height, to make all button heights equal + //group a few items in each row of the left and right tables, to sync the heights _livetrax_toolbar_sizegroup->add_widget(*livetrax_stereo_out_button); _livetrax_toolbar_sizegroup->add_widget(*livetrax_multi_out_button); _livetrax_toolbar_sizegroup->add_widget(*livetrax_lock_button); - _livetrax_toolbar_sizegroup->add_widget(*view_box); + _livetrax_toolbar_sizegroup->add_widget(*livetrax_mixer_view_button); + + _livetrax_toolbar_sizegroup->add_widget(*icon); + _livetrax_toolbar_sizegroup->add_widget(*primary_clock); + + //sync all the view buttons so they look squarer + _livetrax_viewbutton_sizegroup->add_widget(*livetrax_lock_button); + _livetrax_viewbutton_sizegroup->add_widget(*livetrax_view_in_folder_button); + _livetrax_viewbutton_sizegroup->add_widget(*livetrax_prefs_view_button); + _livetrax_viewbutton_sizegroup->add_widget(*livetrax_meter_view_button); + _livetrax_viewbutton_sizegroup->add_widget(*livetrax_editor_view_button); + _livetrax_viewbutton_sizegroup->add_widget(*livetrax_mixer_view_button); Gtk::HBox *livetrax_top_bar = manage (new HBox); livetrax_top_bar->pack_start(livetrax_top_table_l, true, true); - livetrax_top_bar->pack_start(*icon_vb, false, false, 12); + livetrax_top_bar->pack_start(livetrax_top_table_c, true, false); livetrax_top_bar->pack_start(livetrax_top_table_r, true, true); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4fc9a11a92..601083be9a 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3404,18 +3404,18 @@ Editor::setup_toolbar () mouse_mode_size_group->add_widget (nudge_forward_button); mouse_mode_size_group->add_widget (nudge_backward_button); - mouse_mode_hbox->set_spacing (2); if (!Profile->get_livetrax()) { + mouse_mode_hbox->set_spacing (2); mouse_mode_hbox->pack_start (smart_mode_button, false, false); + } else { + mouse_mode_hbox->set_spacing (4); } mouse_mode_hbox->pack_start (mouse_move_button, false, false); mouse_mode_hbox->pack_start (mouse_select_button, false, false); - mouse_mode_hbox->pack_start (mouse_cut_button, false, false); - - if (!Profile->get_livetrax()) { + mouse_mode_hbox->pack_start (mouse_cut_button, false, false); mouse_mode_hbox->pack_start (mouse_timefx_button, false, false); mouse_mode_hbox->pack_start (mouse_grid_button, false, false); mouse_mode_hbox->pack_start (mouse_draw_button, false, false); @@ -3446,9 +3446,13 @@ Editor::setup_toolbar () /* Zoom */ - _zoom_box.set_spacing (2); - _zoom_box.set_border_width (2); - + if (!Profile->get_livetrax()) { + _zoom_box.set_spacing (2); + _zoom_box.set_border_width (2); + } else { + _zoom_box.set_spacing (4); + _zoom_box.set_border_width (0); + } RefPtr act; zoom_preset_selector.set_name ("zoom button"); @@ -3483,9 +3487,13 @@ Editor::setup_toolbar () } /* Track zoom buttons */ - _track_box.set_spacing (2); - _track_box.set_border_width (2); - + if (!ARDOUR::Profile->get_livetrax()) { + _track_box.set_spacing (2); + _track_box.set_border_width (2); + } else { + _track_box.set_spacing (4); + _track_box.set_border_width (0); + } visible_tracks_selector.set_name ("zoom button"); if (Profile->get_mixbus()) { visible_tracks_selector.set_icon (ArdourIcon::TimeAxisExpand); diff --git a/gtk2_ardour/icons/harrison.png b/gtk2_ardour/icons/harrison.png index 7f8fa53a14f2679c66b8b34c31d1c8c2e0368e2c..2e2a6100b75f98d03b2ae954c329a7086d2598e9 100644 GIT binary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