From 9a03fa59b143068fc3570a1a29af34f818131530 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 29 Oct 2024 13:18:47 -0500 Subject: [PATCH] store and recall the sidebar List visibility on the trigger page --- gtk2_ardour/trigger_page.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gtk2_ardour/trigger_page.cc b/gtk2_ardour/trigger_page.cc index bcde331d91..4861fc0d9a 100644 --- a/gtk2_ardour/trigger_page.cc +++ b/gtk2_ardour/trigger_page.cc @@ -242,6 +242,12 @@ TriggerPage::get_state () const node->add_child_nocopy (_midi_editor->get_state()); + Glib::RefPtr act = ActionManager::get_toggle_action ("Cues", "ToggleTriggerList"); + node->set_property ("show-trigger-list", act->get_active ()); + + act = ActionManager::get_toggle_action ("Cues", "ToggleTriggerProps"); + node->set_property ("show-trigger-properties", act->get_active ()); + return *node; } @@ -258,6 +264,24 @@ TriggerPage::set_state (const XMLNode& node, int version) _midi_editor->set_state (*mn, version); } + bool yn = true; + node.get_property ("show-trigger-list", yn); + { + Glib::RefPtr tact = ActionManager::get_toggle_action (X_("Cues"), X_("ToggleTriggerList")); + /* do it twice to force the change */ + tact->set_active (!yn); + tact->set_active (yn); + } + + yn = true; // show properties by default + node.get_property ("show-trigger-props", yn); + { + Glib::RefPtr tact = ActionManager::get_toggle_action (X_("Cues"), X_("ToggleTriggerProps")); + /* do it twice to force the change */ + tact->set_active (!yn); + tact->set_active (yn); + } + return Tabbable::set_state (node, version); }