Consolidate ToggleAction cast, use new API

Furthermore we can assume that all Actions are registered and
Unregistered actions will ::abort() execution.
This commit is contained in:
Robin Gareus 2019-02-28 23:54:42 +01:00
parent 00934aec0d
commit 8244026533
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
9 changed files with 91 additions and 233 deletions

View file

@ -941,14 +941,10 @@ ARDOUR_UI::editor_meter_peak_button_release (GdkEventButton* ev)
void
ARDOUR_UI::toggle_mixer_space()
{
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalMixer");
if (act) {
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
mixer->maximise_mixer_space ();
} else {
mixer->restore_mixer_space ();
}
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Common", "ToggleMaximalMixer");
if (tact->get_active()) {
mixer->maximise_mixer_space ();
} else {
mixer->restore_mixer_space ();
}
}