diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 730594d09b..2636bc015d 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -376,6 +376,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void hide_tabbable (Gtkmm2ext::Tabbable*); void detach_tabbable (Gtkmm2ext::Tabbable*); void attach_tabbable (Gtkmm2ext::Tabbable*); + void change_tabbable_visibility (Gtkmm2ext::Tabbable*); void tabbable_state_change (Gtkmm2ext::Tabbable&); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index bb7140bf74..869bda877b 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -328,6 +328,16 @@ ARDOUR_UI::unload_session (bool hide_stuff) return 0; } +void +ARDOUR_UI::change_tabbable_visibility (Tabbable* t) +{ + if (!t) { + return; + } + + t->change_visibility(); +} + void ARDOUR_UI::show_tabbable (Tabbable* t) { diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 14891eee4c..da88fab6b1 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -238,6 +238,14 @@ ARDOUR_UI::install_actions () global_actions.register_action (common_actions, X_("detach-mixer"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), mixer)); global_actions.register_action (common_actions, X_("detach-preferences"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), rc_option_editor)); + /* These "change" actions are not intended to be used inside menus, but + are for the tab/window control buttons, which have somewhat odd + semantics. + */ + global_actions.register_action (common_actions, X_("change-editor-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::change_tabbable_visibility), editor)); + global_actions.register_action (common_actions, X_("change-mixer-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::change_tabbable_visibility), mixer)); + global_actions.register_action (common_actions, X_("change-preferences-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::change_tabbable_visibility), rc_option_editor)); + /* windows visibility actions */ global_actions.register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space)); @@ -560,11 +568,11 @@ ARDOUR_UI::build_menu_bar () prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor)); - editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("show-editor"))); + editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility"))); editor_visibility_button.set_name (X_("page switch button")); - mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("show-mixer"))); + mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility"))); mixer_visibility_button.set_name (X_("page switch button")); - prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("show-preferences"))); + prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility"))); prefs_visibility_button.set_name (X_("page switch button")); Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button,