diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-11-20 09:28:05 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-22 15:31:25 -0500 |
commit | 64de2b415a7db1e2a89f47629de5e3f824d8ebec (patch) | |
tree | ddb732c7679198fcef1849a57e0bcb573cee028b /gtk2_ardour | |
parent | 361c8421df8361033161372cc2392647c8a75920 (diff) |
use Tabbable::change_visibility to make tab/window control buttons do the right thing
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 14 |
3 files changed, 22 insertions, 3 deletions
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 @@ -329,6 +329,16 @@ ARDOUR_UI::unload_session (bool hide_stuff) } void +ARDOUR_UI::change_tabbable_visibility (Tabbable* t) +{ + if (!t) { + return; + } + + t->change_visibility(); +} + +void ARDOUR_UI::show_tabbable (Tabbable* t) { if (!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, |