summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui_dependents.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-09-22 00:41:25 +0000
committerCarl Hetherington <carl@carlh.net>2010-09-22 00:41:25 +0000
commit096f146d94b20d8b68a838d2f5151765523869b4 (patch)
treee860eebf2980cf207844d9645f5171ea69aa0b5f /gtk2_ardour/ardour_ui_dependents.cc
parent4d908a12fd812e5ae14ea56d6fe626e365d15f63 (diff)
Tidy up Window menu a bit; use ToggleActions for all relevant things, cleanup editor/mixer options a bit.
git-svn-id: svn://localhost/ardour2/branches/3.0@7828 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui_dependents.cc')
-rw-r--r--gtk2_ardour/ardour_ui_dependents.cc43
1 files changed, 38 insertions, 5 deletions
diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc
index fb5757a809..4d38c51e20 100644
--- a/gtk2_ardour/ardour_ui_dependents.cc
+++ b/gtk2_ardour/ardour_ui_dependents.cc
@@ -93,7 +93,6 @@ ARDOUR_UI::goto_editor_window ()
editor->show_window ();
editor->present ();
- _mixer_on_top = false;
flush_pending ();
}
@@ -102,17 +101,51 @@ ARDOUR_UI::goto_mixer_window ()
{
mixer->show_window ();
mixer->present ();
- _mixer_on_top = true;
flush_pending ();
}
void
-ARDOUR_UI::toggle_editor_mixer_on_top ()
+ARDOUR_UI::toggle_mixer_window ()
{
- if (_mixer_on_top) {
- goto_editor_window ();
+ Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer"));
+ if (!act) {
+ return;
+ }
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+
+ if (tact->get_active()) {
+ goto_mixer_window ();
} else {
+ mixer->hide ();
+ }
+}
+
+void
+ARDOUR_UI::toggle_mixer_on_top ()
+{
+ Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer-on-top"));
+ if (!act) {
+ return;
+ }
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+
+ if (tact->get_active()) {
+
+ /* Toggle the mixer to `visible' if required */
+ act = ActionManager::get_action (X_("Common"), X_("toggle-mixer"));
+ if (act) {
+ tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+
+ if (!tact->get_active()) {
+ tact->set_active ();
+ }
+ }
+
goto_mixer_window ();
+ } else {
+ goto_editor_window ();
}
}