From 1158271f728dee55fcbd4ae942f04a70fa8be852 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 15 Jul 2015 16:24:12 -0400 Subject: remove "toggle-foo" style actions related to editor/mixer windows and provide new methods that just use Tabbable::make_visible() --- gtk2_ardour/ardour.menus.in | 5 +- gtk2_ardour/ardour_ui.cc | 6 -- gtk2_ardour/ardour_ui.h | 7 +- gtk2_ardour/ardour_ui_dialogs.cc | 126 ++++-------------------------------- gtk2_ardour/ardour_ui_ed.cc | 5 +- gtk2_ardour/mnemonic-us.bindings.in | 2 +- gtk2_ardour/window_manager.h | 1 - 7 files changed, 23 insertions(+), 129 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index 36211a79e4..d6ae12b5a5 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -275,6 +275,7 @@ + @@ -510,9 +511,9 @@ - + + - diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 1754abb808..f42f035efa 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1031,8 +1031,6 @@ ARDOUR_UI::starting () use_config (); - goto_editor_window (); - WM::Manager::instance().show_visible (); /* We have to do this here since goto_editor_window() ends up calling show_all() on the @@ -3170,8 +3168,6 @@ ARDOUR_UI::close_session() if (get_session_parameters (true, false)) { exit (1); } - - goto_editor_window (); } /** @param snap_name Snapshot name (without .ardour suffix). @@ -3308,8 +3304,6 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name, session_loaded = true; - goto_editor_window (); - if (_session) { _session->set_clean (); } diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index ce4125edca..5186ce6488 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -374,11 +374,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr Gtkmm2ext::Bindings _global_bindings; - void goto_editor_window (); - void goto_mixer_window (); - void toggle_mixer_window (); + void show_editor (); + void show_mixer (); + void show_application_preferences (); void toggle_meterbridge (); - void toggle_editor_mixer (); int setup_windows (); void setup_transport (); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 2b24b8535a..fb4f3d52a1 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -330,98 +330,39 @@ _hide_splash (gpointer arg) } void -ARDOUR_UI::goto_editor_window () +ARDOUR_UI::show_application_preferences () { if (splash && splash->is_visible()) { // in 2 seconds, hide the splash screen Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000); } - if (!editor->window_visible()) { - /* goto tab */ - editor->show_tab (); - return; - } - - editor->show_window (); - editor->present (); - - /* editor should now be on top */ - if (UIConfiguration::instance()->get_transients_follow_front()) { - WM::Manager::instance().set_transient_for (editor->own_window()); - } - _mixer_on_top = false; + rc_option_editor->make_visible (); } void -ARDOUR_UI::goto_mixer_window () +ARDOUR_UI::show_editor () { - Glib::RefPtr win; - Glib::RefPtr screen; - - if (editor && editor->own_window()) { - win = editor->own_window ()->get_window(); - } - - if (win) { - screen = win->get_screen(); - } else { - screen = Gdk::Screen::get_default(); - } - - if (g_getenv ("ARDOUR_LOVES_STUPID_TINY_SCREENS") == 0 && screen && screen->get_height() < 700) { - Gtk::MessageDialog msg (_("This screen is not tall enough to display the mixer window")); - msg.run (); - return; + if (splash && splash->is_visible()) { + // in 2 seconds, hide the splash screen + Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000); } - mixer->show_window (); - - // mixer->present (); - /* mixer should now be on top */ - //if (UIConfiguration::instance().get_transients_follow_front()) { - // WM::Manager::instance().set_transient_for (mixer); - //} - - _mixer_on_top = true; + editor->make_visible (); } void -ARDOUR_UI::toggle_mixer_window () +ARDOUR_UI::show_mixer () { - /* thse windows are created in ARDOUR_UI::setup_windows() - * it should be impossible to get here with any of them being NULL - */ - assert (editor && mixer && meterbridge); - - bool show = false; - bool obscuring = false; - - if (!mixer->window_visible() || editor->window_visible()) { - return; - } - - - - if (!mixer->window_visible ()) { - show = true; - } else if ( (!editor->not_visible () && ARDOUR_UI_UTILS::windows_overlap (editor->own_window(), mixer->own_window())) - || (!meterbridge->not_visible () && ARDOUR_UI_UTILS::windows_overlap (meterbridge, mixer->own_window())) - ) { - obscuring = true; - } - - if (obscuring && (editor->own_window()->property_has_toplevel_focus() || meterbridge->property_has_toplevel_focus())) { - show = true; + if (splash && splash->is_visible()) { + // in 2 seconds, hide the splash screen + Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000); } - if (show) { - goto_mixer_window (); - } else { - mixer->own_window()->hide (); - } + mixer->make_visible (); } + void ARDOUR_UI::toggle_meterbridge () { @@ -450,47 +391,6 @@ ARDOUR_UI::toggle_meterbridge () } } -void -ARDOUR_UI::toggle_editor_mixer () -{ - bool obscuring = false; - - if (!mixer->window_visible() || !editor->window_visible()) { - return; - } - - if (editor && mixer && mixer->own_window()) { - if (ARDOUR_UI_UTILS::windows_overlap (editor->own_window(), mixer->own_window())) { - obscuring = true; - } - } - - if (mixer && !mixer->not_visible() && mixer->own_window() && mixer->own_window()->property_has_toplevel_focus()) { - if (obscuring) { - goto_editor_window(); - } - } else if (editor && editor->window_visible() && editor->own_window()->property_has_toplevel_focus()) { - if (obscuring) { - goto_mixer_window(); - } - } else if (mixer) { - if (obscuring) { - goto_mixer_window (); - } - } else if (editor) { - if (obscuring) { - goto_editor_window (); - } - } else if (obscuring) { - //it's unclear what to do here, so just do the opposite of what we did last time (old behavior) - if (_mixer_on_top) { - goto_editor_window (); - } else { - goto_mixer_window (); - } - } -} - void ARDOUR_UI::new_midi_tracer_window () { diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 8564cf1f1d..43ad3e3ee3 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -215,6 +215,9 @@ ARDOUR_UI::install_actions () common_actions = ActionGroup::create (X_("Common")); ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (hide_return (sigc::mem_fun(*this, &ARDOUR_UI::finish)))); ActionManager::register_action (common_actions, X_("Hide"), _("Hide"), sigc::mem_fun (*this, &ARDOUR_UI::hide_application)); + ActionManager::register_action (common_actions, X_("show-editor"), _("Show Editor"), sigc::mem_fun (*this, &ARDOUR_UI::show_editor)); + ActionManager::register_action (common_actions, X_("show-mixer"), _("Show Mixer"), sigc::mem_fun (*this, &ARDOUR_UI::show_mixer)); + ActionManager::register_action (common_actions, X_("show-application-preferences"), _("Preferences"), sigc::mem_fun (*this, &ARDOUR_UI::show_application_preferences)); /* windows visibility actions */ @@ -232,8 +235,6 @@ ARDOUR_UI::install_actions () if (Profile->get_mixbus()) ActionManager::register_action (common_actions, X_("show-ui-prefs"), _("Show more UI preferences"), sigc::mem_fun (*this, &ARDOUR_UI::show_ui_prefs)); - ActionManager::register_action (common_actions, X_("toggle-mixer"), S_("Window|Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_mixer_window)); - ActionManager::register_action (common_actions, X_("toggle-editor-mixer"), _("Toggle Editor+Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_editor_mixer)); ActionManager::register_action (common_actions, X_("toggle-meterbridge"), S_("Window|Meterbridge"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_meterbridge)); ActionManager::register_action (common_actions, X_("reattach-all-tearoffs"), _("Reattach All Tearoffs"), sigc::mem_fun (*this, &ARDOUR_UI::reattach_all_tearoffs)); diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in index c36cd39b21..29ac3e875d 100644 --- a/gtk2_ardour/mnemonic-us.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -157,7 +157,7 @@ This mode provides many different operations on both regions and control points, @sess|Main/ExportAudio|<@SECONDARY@>e|export session @select|Editor/select-all-after-edit-cursor|<@PRIMARY@><@TERTIARY@>e|select all after EP @vis|Editor/show-editor-mixer|<@TERTIARY@>e|toggle editor window mixer -@wvis|Common/goto-editor|<@SECONDARY@>e|toggle editor window +@wvis|Common/goto-editor|<@SECONDARY@>e|show editor tab/window @mmode|MouseMode/set-mouse-mode-range|r|range mode @edit|Editor/redo|<@PRIMARY@>r|redo @trans|Transport/Record|<@TERTIARY@>r|engage record diff --git a/gtk2_ardour/window_manager.h b/gtk2_ardour/window_manager.h index 5d1349f258..5ee9d16f99 100644 --- a/gtk2_ardour/window_manager.h +++ b/gtk2_ardour/window_manager.h @@ -153,7 +153,6 @@ class ProxyWithConstructor: public ProxyBase private: boost::function creator; ->>>>>>> first compilable version of tabbable design. }; template -- cgit v1.2.3