diff --git a/gtk2_ardour/theme_manager.cc b/gtk2_ardour/theme_manager.cc index fb4cc88550..ffceb36109 100644 --- a/gtk2_ardour/theme_manager.cc +++ b/gtk2_ardour/theme_manager.cc @@ -84,8 +84,8 @@ ThemeManager::ThemeManager() color_dialog.get_ok_button()->signal_clicked().connect (bind (mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_ACCEPT)); color_dialog.get_cancel_button()->signal_clicked().connect (bind (mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_CANCEL)); - dark_button.signal_clicked().connect (bind (mem_fun (*this, &ThemeManager::load_rc), 1)); - light_button.signal_clicked().connect (bind (mem_fun (*this, &ThemeManager::load_rc), 2)); + dark_button.signal_toggled().connect (mem_fun (*this, &ThemeManager::on_dark_theme_button_toggled)); + light_button.signal_toggled().connect (mem_fun (*this, &ThemeManager::on_light_theme_button_toggled)); set_size_request (-1, 400); } @@ -196,14 +196,20 @@ load_rc_file (const string& filename) } void -ThemeManager::load_rc(int which) +ThemeManager::on_dark_theme_button_toggled() { - if (which == 1) { - Config->set_ui_rc_file("ardour2_ui_dark.rc"); - } else { - Config->set_ui_rc_file("ardour2_ui_light.rc"); - } + if (!dark_button.get_active()) return; + Config->set_ui_rc_file("ardour2_ui_dark.rc"); + load_rc_file (Config->get_ui_rc_file()); +} + +void +ThemeManager::on_light_theme_button_toggled() +{ + if (!light_button.get_active()) return; + + Config->set_ui_rc_file("ardour2_ui_light.rc"); load_rc_file (Config->get_ui_rc_file()); } diff --git a/gtk2_ardour/theme_manager.h b/gtk2_ardour/theme_manager.h index a8a70b6c9a..cba3a9fd55 100644 --- a/gtk2_ardour/theme_manager.h +++ b/gtk2_ardour/theme_manager.h @@ -37,8 +37,10 @@ class ThemeManager : public ArdourDialog ~ThemeManager(); int save (std::string path); - void load_rc (int which); void setup_theme (); + + void on_dark_theme_button_toggled (); + void on_light_theme_button_toggled (); private: struct ColorDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {