summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour_ui.h5
-rw-r--r--gtk2_ardour/ardour_ui2.cc8
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc2
-rw-r--r--gtk2_ardour/ardour_ui_options.cc12
-rw-r--r--gtk2_ardour/editor.cc29
-rw-r--r--gtk2_ardour/editor.h4
-rw-r--r--gtk2_ardour/public_editor.h4
7 files changed, 33 insertions, 31 deletions
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 6e867292dc..b022c13ba4 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -166,6 +166,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_editing_space_force(bool force);
void toggle_keep_tearoffs();
Gtk::Tooltips& tooltips() { return _tooltips; }
@@ -240,8 +241,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
gint exit_on_main_window_close (GdkEventAny *);
- void maximise_editing_space ();
- void restore_editing_space ();
+ void maximise_editing_space (bool force);
+ void restore_editing_space (bool force);
void setup_profile ();
void setup_tooltips ();
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index 19e8a8ce6f..b16c466f19 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -606,18 +606,18 @@ ARDOUR_UI::editor_realized ()
}
void
-ARDOUR_UI::maximise_editing_space ()
+ARDOUR_UI::maximise_editing_space (bool force)
{
if (editor) {
- editor->maximise_editing_space ();
+ editor->maximise_editing_space (force);
}
}
void
-ARDOUR_UI::restore_editing_space ()
+ARDOUR_UI::restore_editing_space (bool force)
{
if (editor) {
- editor->restore_editing_space ();
+ editor->restore_editing_space (force);
}
}
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index 394b1c5470..9a2a7b2043 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -225,7 +225,7 @@ 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));
+ act = ActionManager::register_toggle_action (common_actions, X_("KeepTearoffs"), _("Show Toolbars"), mem_fun (*this, &ARDOUR_UI::toggle_keep_tearoffs));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::register_toggle_action (common_actions, X_("toggle-mixer"), S_("Window|Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_mixer_window));
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index f2f7d397df..ea299b2f04 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -52,7 +52,7 @@ ARDOUR_UI::toggle_keep_tearoffs ()
{
ActionManager::toggle_config_state ("Common", "KeepTearoffs", &RCConfiguration::set_keep_tearoffs, &RCConfiguration::get_keep_tearoffs);
- ARDOUR_UI::toggle_editing_space ();
+ ARDOUR_UI::toggle_editing_space_force (true);
}
void
@@ -277,14 +277,20 @@ ARDOUR_UI::toggle_video_sync()
void
ARDOUR_UI::toggle_editing_space()
{
+ toggle_editing_space_force(false);
+}
+
+void
+ARDOUR_UI::toggle_editing_space_force(bool force)
+{
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
if (act) {
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
- maximise_editing_space ();
+ maximise_editing_space (force);
} else {
- restore_editing_space ();
+ restore_editing_space (force);
}
}
}
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index e17c8046c4..e096968b87 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -3929,40 +3929,35 @@ Editor::session_state_saved (string)
}
void
-Editor::maximise_editing_space ()
+Editor::maximise_editing_space (bool force)
{
- if (_maximised) {
+ if (_maximised && !force) {
return;
}
fullscreen ();
- if (!Config->get_keep_tearoffs()) {
- /* these calls will leave each tearoff visible *if* it is torn off,
- but invisible otherwise.
- */
- _mouse_mode_tearoff->set_visible (false);
- _tools_tearoff->set_visible (false);
- _zoom_tearoff->set_visible (false);
- }
+ bool visible = Config->get_keep_tearoffs();
+ _mouse_mode_tearoff->set_visible (visible);
+ _tools_tearoff->set_visible (visible);
+ _zoom_tearoff->set_visible (visible);
_maximised = true;
}
void
-Editor::restore_editing_space ()
+Editor::restore_editing_space (bool force)
{
- if (!_maximised) {
+ if (!_maximised && !force) {
return;
}
unfullscreen();
- if (!Config->get_keep_tearoffs()) {
- _mouse_mode_tearoff->set_visible (true);
- _tools_tearoff->set_visible (true);
- _zoom_tearoff->set_visible (true);
- }
+ bool visible = Config->get_keep_tearoffs();
+ _mouse_mode_tearoff->set_visible (visible);
+ _tools_tearoff->set_visible (visible);
+ _zoom_tearoff->set_visible (visible);
_maximised = false;
}
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index f146b198e1..af0863f263 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -397,8 +397,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void prepare_for_cleanup ();
void finish_cleanup ();
- void maximise_editing_space();
- void restore_editing_space();
+ void maximise_editing_space(bool force);
+ void restore_editing_space(bool force);
void reset_x_origin (framepos_t);
void reset_x_origin_to_follow_playhead ();
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index 80b3e2aa02..c660b3b5b6 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -272,8 +272,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
virtual void finish_cleanup () = 0;
virtual void reset_x_origin (framepos_t frame) = 0;
virtual void remove_last_capture () = 0;
- virtual void maximise_editing_space () = 0;
- virtual void restore_editing_space () = 0;
+ virtual void maximise_editing_space (bool force) = 0;
+ virtual void restore_editing_space (bool force) = 0;
virtual framepos_t get_preferred_edit_position (bool ignore_playhead = false, bool from_context_menu = false) = 0;
virtual void toggle_meter_updating() = 0;
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;