summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2007-06-27 12:12:39 +0000
committerTim Mayberry <mojofunk@gmail.com>2007-06-27 12:12:39 +0000
commitbe26fa02ce6e742de057c9fd2f9e6502cb57cbdc (patch)
treef75ff9dfce1b118157acc140a59c91665921b7df /gtk2_ardour
parentf9910c90ead69765d277a3711efda0673e3d3f8a (diff)
Use signal_toggled instead of signal_clicked in ThemeManager so a theme is only "loaded" once.
git-svn-id: svn://localhost/ardour2/trunk@2060 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/theme_manager.cc22
-rw-r--r--gtk2_ardour/theme_manager.h4
2 files changed, 17 insertions, 9 deletions
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 {