mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
set Theme buttons on state reset
cleaner version of last commit, set GUI elements on state-reset.
This commit is contained in:
parent
0c8947491a
commit
c7c8cc7dc7
2 changed files with 28 additions and 6 deletions
|
|
@ -170,12 +170,7 @@ ThemeManager::ThemeManager()
|
||||||
color_dialog.get_colorsel()->set_has_opacity_control (true);
|
color_dialog.get_colorsel()->set_has_opacity_control (true);
|
||||||
color_dialog.get_colorsel()->set_has_palette (true);
|
color_dialog.get_colorsel()->set_has_palette (true);
|
||||||
|
|
||||||
flat_buttons.set_active (ARDOUR_UI::config()->get_flat_buttons());
|
set_ui_to_state();
|
||||||
blink_rec_button.set_active (ARDOUR_UI::config()->get_blink_rec_arm());
|
|
||||||
region_color_button.set_active (ARDOUR_UI::config()->get_color_regions_using_track_color());
|
|
||||||
show_clipping_button.set_active (ARDOUR_UI::config()->get_show_waveform_clipping());
|
|
||||||
waveform_gradient_depth.set_value(ARDOUR_UI::config()->get_waveform_gradient_depth());
|
|
||||||
timeline_item_gradient_depth.set_value(ARDOUR_UI::config()->get_timeline_item_gradient_depth());
|
|
||||||
|
|
||||||
color_dialog.get_ok_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_ACCEPT));
|
color_dialog.get_ok_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_ACCEPT));
|
||||||
color_dialog.get_cancel_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_CANCEL));
|
color_dialog.get_cancel_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_CANCEL));
|
||||||
|
|
@ -346,11 +341,37 @@ ThemeManager::on_light_theme_button_toggled()
|
||||||
uic->set_color_file("light");
|
uic->set_color_file("light");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ThemeManager::set_ui_to_state()
|
||||||
|
{
|
||||||
|
/* there is no way these values can change individually
|
||||||
|
* by themselves (w/o user-interaction)
|
||||||
|
* hence a common combined update function suffices
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (ARDOUR_UI::config()->get_color_file() == "light") {
|
||||||
|
light_button.set_active(true);
|
||||||
|
} else {
|
||||||
|
dark_button.set_active(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* there is no need to block signal handlers, here,
|
||||||
|
* all elements check if the value has changed and ignore NOOPs
|
||||||
|
*/
|
||||||
|
flat_buttons.set_active (ARDOUR_UI::config()->get_flat_buttons());
|
||||||
|
blink_rec_button.set_active (ARDOUR_UI::config()->get_blink_rec_arm());
|
||||||
|
region_color_button.set_active (ARDOUR_UI::config()->get_color_regions_using_track_color());
|
||||||
|
show_clipping_button.set_active (ARDOUR_UI::config()->get_show_waveform_clipping());
|
||||||
|
waveform_gradient_depth.set_value(ARDOUR_UI::config()->get_waveform_gradient_depth());
|
||||||
|
timeline_item_gradient_depth.set_value(ARDOUR_UI::config()->get_timeline_item_gradient_depth());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ThemeManager::reset_canvas_colors()
|
ThemeManager::reset_canvas_colors()
|
||||||
{
|
{
|
||||||
ARDOUR_UI::config()->load_defaults();
|
ARDOUR_UI::config()->load_defaults();
|
||||||
ARDOUR_UI::config()->save_state ();
|
ARDOUR_UI::config()->save_state ();
|
||||||
|
set_ui_to_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArdourCanvas::Container*
|
ArdourCanvas::Container*
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,7 @@ class ThemeManager : public Gtk::VBox
|
||||||
void modifier_edited (Gtk::Range*, std::string);
|
void modifier_edited (Gtk::Range*, std::string);
|
||||||
|
|
||||||
void colors_changed ();
|
void colors_changed ();
|
||||||
|
void set_ui_to_state ();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_gtk_color_manager_h__ */
|
#endif /* __ardour_gtk_color_manager_h__ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue