From cd6c3af27d754e7d7dd09049c9fdb26af0120523 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 Jul 2010 23:29:36 +0000 Subject: [PATCH] Patch from dx9s to rearrange the View/Window menus a bit and add an option to keap tearoff toolbars when maximising editor space. Fixes #2974. git-svn-id: svn://localhost/ardour2/branches/3.0@7480 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour.menus.in | 44 ++++++++++++++-------- gtk2_ardour/ardour_ui.h | 1 + gtk2_ardour/ardour_ui2.cc | 3 ++ gtk2_ardour/ardour_ui_ed.cc | 2 + gtk2_ardour/ardour_ui_options.cc | 10 +++++ gtk2_ardour/editor.cc | 6 +++ libs/ardour/ardour/rc_configuration_vars.h | 1 + 7 files changed, 52 insertions(+), 15 deletions(-) diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index 6cf7f0dbb9..008d250f00 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -297,6 +297,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -341,18 +361,7 @@ - - - - - - - - - - - - + @@ -397,7 +406,8 @@ - + + @@ -420,17 +430,21 @@ - - + + + + + + diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index da85048fb4..4e8137d76e 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -168,6 +168,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void new_midi_tracer_window (); void toggle_route_params_window (); void toggle_editing_space(); + void toggle_keep_tearoffs(); Gtk::Tooltips& tooltips() { return _tooltips; } diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index da518e1b13..ddca410dc4 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -949,6 +949,9 @@ ARDOUR_UI::maximise_editing_space () transport_tearoff->set_visible (false); editor->maximise_editing_space (); + if (Config->get_keep_tearoffs()) { + transport_tearoff->set_visible (true); + } } void diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index e60f681823..fbd1a7bccc 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -212,6 +212,8 @@ ARDOUR_UI::install_actions () /* windows visibility actions */ ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space)); + act = ActionManager::register_toggle_action (common_actions, X_("KeepTearoffs"), _("Toolbars when Maximised"), mem_fun (*this, &ARDOUR_UI::toggle_keep_tearoffs)); + ActionManager::session_sensitive_actions.push_back (act); ActionManager::register_action (common_actions, X_("goto-editor"), _("Show Editor"), sigc::mem_fun(*this, &ARDOUR_UI::goto_editor_window)); ActionManager::register_action (common_actions, X_("goto-mixer"), _("Show Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::goto_mixer_window)); diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index 72404798bc..fd914b95dd 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -46,6 +46,14 @@ using namespace Gtkmm2ext; using namespace ARDOUR; using namespace PBD; +void +ARDOUR_UI::toggle_keep_tearoffs () +{ + ActionManager::toggle_config_state ("Common", "KeepTearoffs", &RCConfiguration::set_keep_tearoffs, &RCConfiguration::get_keep_tearoffs); + + ARDOUR_UI::toggle_editing_space (); +} + void ARDOUR_UI::toggle_external_sync() { @@ -334,6 +342,8 @@ ARDOUR_UI::parameter_changed (std::string p) } #endif + } else if (p == "keep-tearoffs") { + ActionManager::map_some_state ("Common", "KeepTearoffs", &RCConfiguration::get_keep_tearoffs); } else if (p == "mmc-control") { ActionManager::map_some_state ("options", "UseMMC", &RCConfiguration::get_mmc_control); } else if (p == "midi-feedback") { diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 42b1a99fc5..49470849c6 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4171,6 +4171,12 @@ Editor::maximise_editing_space () } else { editor_summary_pane.set_position (post_maximal_vertical_pane_position); } + + if (Config->get_keep_tearoffs()) { + _mouse_mode_tearoff->set_visible (true); + _tools_tearoff->set_visible (true); + _zoom_tearoff->set_visible (true); + } } void diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index be07069f7f..f8d2c9500d 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -136,6 +136,7 @@ CONFIG_VARIABLE (uint32_t, periodic_safety_backup_interval, "periodic-safety-bac CONFIG_VARIABLE (float, automation_interval, "automation-interval", 50) CONFIG_VARIABLE (bool, sync_all_route_ordering, "sync-all-route-ordering", true) CONFIG_VARIABLE (bool, only_copy_imported_files, "only-copy-imported-files", false) +CONFIG_VARIABLE (bool, keep_tearoffs, "keep-tearoffs", false) CONFIG_VARIABLE (bool, new_plugins_active, "new-plugins-active", true) CONFIG_VARIABLE (std::string, keyboard_layout, "keyboard-layout", "ansi") CONFIG_VARIABLE (std::string, default_bindings, "default-bindings", "ardour")