diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-08-04 14:30:41 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-22 15:31:23 -0500 |
commit | 00933950b7f21807fc4edf615876060f85882474 (patch) | |
tree | 33544e3960d4b3f6bb05915bac17516d76f9c802 /gtk2_ardour/window_manager.cc | |
parent | 2c6799f247afa3b77f0e3d878666409fd7f728bc (diff) |
small rationalization of naming and code for managing plugin GUI visibility
Diffstat (limited to 'gtk2_ardour/window_manager.cc')
-rw-r--r-- | gtk2_ardour/window_manager.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gtk2_ardour/window_manager.cc b/gtk2_ardour/window_manager.cc index e5913c59e8..eadfc196c3 100644 --- a/gtk2_ardour/window_manager.cc +++ b/gtk2_ardour/window_manager.cc @@ -89,8 +89,20 @@ Manager::remove (const ProxyBase* info) void Manager::toggle_window (ProxyBase* proxy) { - if (proxy) { - proxy->toggle (); + + Glib::RefPtr<Gtk::Action> act = ARDOUR_UI::instance()->global_actions.find_action (string_compose ("%1/%2", window_actions->get_name(), proxy->action_name())); + if (!act) { + return; + } + Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic (act); + if (!tact) { + return; + } + + if (tact->get_active()) { + proxy->present (); + } else { + proxy->hide (); } } |