13
0
Fork 0

LT: toolbar layout: centered icon, transport on left, visibility on right

This commit is contained in:
Ben Loftis 2024-05-06 12:07:11 -05:00
parent f81c9c83de
commit 462d3bd6cf
3 changed files with 65 additions and 40 deletions

View File

@ -342,12 +342,14 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, dsp_statistics_window (X_("dsp-statistics"), _("Performance Meters"))
, transport_masters_window (X_("transport-masters"), _("Transport Masters"))
, livetrax_track_dialog (nullptr)
, _livetrax_toolbar_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL))
, _livetrax_centering_sizegroup (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL))
, _livetrax_btn_rec_all (_("Rec All"))
, _livetrax_btn_rec_none (_("Rec None"))
, _livetrax_btn_peak_reset (_("Reset Peak Hold"))
, _livetrax_btn_marker_new (_("New"))
, _livetrax_btn_prev_marker (_("Prev"))
, _livetrax_btn_next_marker (_("Next"))
, _livetrax_btn_marker_new (_("Marker"))
, _livetrax_btn_prev_marker (_("<< Prev"))
, _livetrax_btn_next_marker (_("Next >>"))
, session_option_editor (X_("session-options-editor"), _("Properties"), boost::bind (&ARDOUR_UI::create_session_option_editor, this))
, add_video_dialog (X_("add-video"), _("Add Video"), boost::bind (&ARDOUR_UI::create_add_video_dialog, this))
, bundle_manager (X_("bundle-manager"), _("Bundle Manager"), boost::bind (&ARDOUR_UI::create_bundle_manager, this))

View File

@ -68,6 +68,7 @@
#include <gtkmm/menubar.h>
#include <gtkmm/textbuffer.h>
#include <gtkmm/adjustment.h>
#include <gtkmm/sizegroup.h>
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/bindings.h"
@ -641,7 +642,8 @@ private:
/* LiveTrax */
Gtk::Table livetrax_top_table;
Gtk::Table livetrax_top_table_l;
Gtk::Table livetrax_top_table_r;
Gtk::Table livetrax_edit_table;
Gtk::HBox livetrax_meter_bar;
Gtk::HBox livetrax_editor_bar;
@ -656,6 +658,9 @@ private:
ArdourWidgets::ArdourButton _livetrax_btn_prev_marker;
ArdourWidgets::ArdourButton _livetrax_btn_next_marker;
Glib::RefPtr<Gtk::SizeGroup> _livetrax_centering_sizegroup;
Glib::RefPtr<Gtk::SizeGroup> _livetrax_toolbar_sizegroup;
TimeInfoBox* livetrax_time_info_box;
ArdourWidgets::ArdourButton* livetrax_multi_out_button;
ArdourWidgets::ArdourButton* livetrax_stereo_out_button;

View File

@ -418,7 +418,8 @@ ARDOUR_UI::livetrax_setup_windows ()
Gtkmm2ext::Bindings* bindings;
Glib::RefPtr<Action> act;
livetrax_top_table.set_border_width (4);
livetrax_top_table_l.set_border_width (4);
livetrax_top_table_r.set_border_width (4);
EventBox* ev_dsp = manage (new EventBox);
EventBox* ev_timecode = manage (new EventBox);
@ -467,6 +468,10 @@ ARDOUR_UI::livetrax_setup_windows ()
act = ActionManager::get_action (X_("Common"), X_("livetrax-toggle-mixer"));
livetrax_mixer_view_button->set_related_action (act);
livetrax_sr_button = manage (new ArdourButton (ArdourButton::Element (ArdourButton::Text|ArdourButton::Edge|ArdourButton::Body), true));
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);
@ -480,49 +485,62 @@ ARDOUR_UI::livetrax_setup_windows ()
int TCOL = 0;
livetrax_top_table.attach (*livetrax_lock_button, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (*livetrax_view_in_folder_button, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (*livetrax_prefs_view_button, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (*view_box, TCOL, TCOL+3, 1, 2, FILL, FILL, 4, 4); TCOL+=3;
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 (transport_ctrl, TCOL, TCOL+4, 1, 2, FILL, FILL, 4, 4); TCOL+=4;
livetrax_top_table.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++;
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.attach (transport_ctrl, TCOL, TCOL+1, 1, 2, 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.attach (_livetrax_btn_prev_marker, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (_livetrax_btn_marker_new, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (_livetrax_btn_next_marker, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (*primary_clock, TCOL, TCOL+3, 1, 2, FILL, FILL, 4, 4); TCOL+=3;
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.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++;
livetrax_top_table.attach (*icon_vb, TCOL, TCOL+1, 0, 2, FILL, FILL, 4, 4); TCOL++;
livetrax_top_table.attach (_livetrax_btn_rec_all, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (_livetrax_btn_rec_none, TCOL+1, TCOL+2, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (_livetrax_btn_peak_reset, TCOL+2, TCOL+3, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (editor->_track_box, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++;
livetrax_top_table.attach (*editor->mouse_mode_hbox, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++;
livetrax_top_table.attach (editor->_zoom_box, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++;
livetrax_top_table.attach (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, FILL, 4, 4); TCOL++;
livetrax_top_table.attach (sync_button, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++;
livetrax_top_table.attach (*livetrax_ff_dropdown, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.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++;
livetrax_top_table.attach (*livetrax_stereo_out_button, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (*livetrax_multi_out_button, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++;
livetrax_top_table_l.attach (*livetrax_stereo_out_button, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table_l.attach (*livetrax_multi_out_button, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++;
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->_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 (*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 (*manage(new Label("")), TCOL, TCOL+1, 0, 2, EXPAND, 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;
//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
_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);
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_r, true, true);
livetrax_top_table.attach (*ev_dsp, TCOL, TCOL+1, 0, 1, FILL, FILL, 4, 4);
livetrax_top_table.attach (disk_space_label, TCOL, TCOL+1, 1, 2, FILL, FILL, 4, 4); TCOL++;
/* editor bar */