Use signal_toggled instead of signal_clicked in ThemeManager so a theme is only ...
authorTim Mayberry <mojofunk@gmail.com>
Wed, 27 Jun 2007 12:12:39 +0000 (12:12 +0000)
committerTim Mayberry <mojofunk@gmail.com>
Wed, 27 Jun 2007 12:12:39 +0000 (12:12 +0000)
git-svn-id: svn://localhost/ardour2/trunk@2060 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/theme_manager.cc
gtk2_ardour/theme_manager.h

index fb4cc88550e2d22926c463f3d9f7010467d9e9a6..ffceb36109845302e902a509b2a34c073569329e 100644 (file)
@@ -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());
 }
 
index a8a70b6c9a860c696d54e7d1ac6f707c600a6bd1..cba3a9fd5519da253804ffc1e796accc2e7c4a8c 100644 (file)
@@ -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 {