13
0

ArdourUI packs the tabbable visibility buttons

This commit is contained in:
Ben Loftis 2024-10-24 12:31:19 -05:00 committed by Robin Gareus
parent 82a9fc4abb
commit ba2fbfa2cf
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 24 additions and 32 deletions

View File

@ -523,8 +523,7 @@ private:
/* Transport Control */ /* Transport Control */
Gtk::Table transport_table; Gtk::Table tabbables_table;
Gtk::Frame transport_frame;
void toggle_follow_edits (); void toggle_follow_edits ();

View File

@ -231,28 +231,6 @@ ARDOUR_UI::setup_transport ()
/* transport control size-group */ /* transport control size-group */
/* and now the layout... */
/* top level packing */
transport_table.set_spacings (0);
transport_table.set_row_spacings (4);
transport_table.set_border_width (1);
transport_frame.set_name ("TransportFrame");
transport_frame.set_shadow_type (Gtk::SHADOW_NONE);
/* An event box to hold the table. We use this because we want specific
control over the background color, and without this event box,
nothing inside the transport_frame actually draws a background. We
would therefore end up seeing the background of the parent widget,
which is probably some default color. Adding the EventBox adds a
widget that will draw the background, using a style based on
the parent, "TransportFrame".
*/
Gtk::EventBox* ebox = manage (new Gtk::EventBox);
transport_frame.add (*ebox);
ebox->add (transport_table);
//tab selections //tab selections
button_height_size_group->add_widget (trigger_page_visibility_button); button_height_size_group->add_widget (trigger_page_visibility_button);
button_height_size_group->add_widget (recorder_visibility_button); button_height_size_group->add_widget (recorder_visibility_button);
@ -261,18 +239,19 @@ ARDOUR_UI::setup_transport ()
button_height_size_group->add_widget (prefs_visibility_button); button_height_size_group->add_widget (prefs_visibility_button);
/* and the main table layout */ /* and the main table layout */
int vpadding = 1; int vpadding = 3;
int hpadding = 2; int hpadding = 3;
int col = 0; int col = 0;
#define TCOL col, col + 1 #define TCOL col, col + 1
transport_table.attach (recorder_visibility_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding); tabbables_table.attach (recorder_visibility_button, TCOL, 0, 1 , FILL, FILL, hpadding, vpadding);
transport_table.attach (trigger_page_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding); tabbables_table.attach (trigger_page_visibility_button, TCOL, 1, 2 , FILL, FILL, hpadding, vpadding);
++col; ++col;
transport_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding); tabbables_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, FILL, hpadding, vpadding);
transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding); tabbables_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, FILL, hpadding, vpadding);
++col; ++col;
tabbables_table.show_all ();
} }
#undef PX_SCALE #undef PX_SCALE
#undef TCOL #undef TCOL

View File

@ -302,7 +302,6 @@ ARDOUR_UI::setup_windows ()
/* now add the transport sample to the top of main window */ /* now add the transport sample to the top of main window */
main_vpacker.pack_start ( *spacer, false, false); main_vpacker.pack_start ( *spacer, false, false);
main_vpacker.pack_start (transport_frame, false, false);
main_vpacker.pack_start (_tabs, true, true); main_vpacker.pack_start (_tabs, true, true);
setup_transport(); setup_transport();
@ -320,7 +319,6 @@ ARDOUR_UI::setup_windows ()
*/ */
_main_window.add (main_vpacker); _main_window.add (main_vpacker);
transport_frame.show_all ();
apply_window_settings (true); apply_window_settings (true);

View File

@ -625,8 +625,18 @@ ARDOUR_UI::tabs_page_removed (Widget*, guint)
void void
ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page) ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page)
{ {
if (tabbables_table.get_parent ()) {
editor->tab_btn_box ().remove ();
mixer->tab_btn_box ().remove ();
recorder->tab_btn_box ().remove ();
trigger_page->tab_btn_box ().remove ();
}
//pack the tabbables selector in this tab, and set button sensitivity appropriately
if (editor && (page == (guint) _tabs.page_num (editor->contents()))) { if (editor && (page == (guint) _tabs.page_num (editor->contents()))) {
editor->tab_btn_box ().add (tabbables_table);
editor_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive); editor_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive);
if (mixer && (mixer->tabbed() || mixer->tabbed_by_default())) { if (mixer && (mixer->tabbed() || mixer->tabbed_by_default())) {
@ -649,6 +659,8 @@ ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page)
} else if (mixer && (page == (guint) _tabs.page_num (mixer->contents()))) { } else if (mixer && (page == (guint) _tabs.page_num (mixer->contents()))) {
mixer->tab_btn_box ().add (tabbables_table);
if (editor && (editor->tabbed() || editor->tabbed_by_default())) { if (editor && (editor->tabbed() || editor->tabbed_by_default())) {
editor_visibility_button.set_active_state (Gtkmm2ext::Off); editor_visibility_button.set_active_state (Gtkmm2ext::Off);
} }
@ -689,6 +701,8 @@ ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page)
} else if (page == (guint) _tabs.page_num (recorder->contents())) { } else if (page == (guint) _tabs.page_num (recorder->contents())) {
recorder->tab_btn_box ().add (tabbables_table);
if (editor && (editor->tabbed() || editor->tabbed_by_default())) { if (editor && (editor->tabbed() || editor->tabbed_by_default())) {
editor_visibility_button.set_active_state (Gtkmm2ext::Off); editor_visibility_button.set_active_state (Gtkmm2ext::Off);
} }
@ -709,6 +723,8 @@ ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page)
} else if (page == (guint) _tabs.page_num (trigger_page->contents())) { } else if (page == (guint) _tabs.page_num (trigger_page->contents())) {
trigger_page->tab_btn_box ().add (tabbables_table);
if (editor && (editor->tabbed() || editor->tabbed_by_default())) { if (editor && (editor->tabbed() || editor->tabbed_by_default())) {
editor_visibility_button.set_active_state (Gtkmm2ext::Off); editor_visibility_button.set_active_state (Gtkmm2ext::Off);
} }