summaryrefslogtreecommitdiff
path: root/gtk2_ardour/theme_manager.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-02-02 03:57:35 +0000
committerDavid Robillard <d@drobilla.net>2008-02-02 03:57:35 +0000
commit9f63ab9931e6478472853bdda58da47ea29ac125 (patch)
tree7edfb1d16f580e93501c24fa9f9648fe415f3745 /gtk2_ardour/theme_manager.cc
parent85ea9028b52eefb34184deb0fbd4d3c7632a2c38 (diff)
Merge with trunk R2978.
git-svn-id: svn://localhost/ardour2/branches/3.0@2988 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/theme_manager.cc')
-rw-r--r--gtk2_ardour/theme_manager.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk2_ardour/theme_manager.cc b/gtk2_ardour/theme_manager.cc
index f529405878..9968fa9ea0 100644
--- a/gtk2_ardour/theme_manager.cc
+++ b/gtk2_ardour/theme_manager.cc
@@ -50,7 +50,8 @@ sigc::signal<void,uint32_t> ColorChanged;
ThemeManager::ThemeManager()
: ArdourDialog ("ThemeManager"),
dark_button ("Dark Theme"),
- light_button ("Light Theme")
+ light_button ("Light Theme"),
+ reset_button ("Restore Defaults")
{
Gtkmm2ext::WindowTitle title (Glib::get_application_name ());
title += _("Theme Manager");
@@ -81,6 +82,7 @@ ThemeManager::ThemeManager()
get_vbox()->set_homogeneous(false);
get_vbox()->pack_start (theme_selection_hbox, PACK_SHRINK);
+ get_vbox()->pack_start (reset_button, PACK_SHRINK);
get_vbox()->pack_start (scroller);
color_display.signal_button_press_event().connect (mem_fun (*this, &ThemeManager::button_press_event), false);
@@ -92,6 +94,7 @@ ThemeManager::ThemeManager()
color_dialog.get_cancel_button()->signal_clicked().connect (bind (mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_CANCEL));
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));
+ reset_button.signal_clicked().connect (mem_fun (*this, &ThemeManager::reset_canvas_colors));
set_size_request (-1, 400);
setup_theme ();
@@ -226,6 +229,8 @@ void
ThemeManager::setup_theme ()
{
int r, g, b, a;
+ color_list->clear();
+
for (std::vector<UIConfigVariable<uint32_t> *>::iterator i = ARDOUR_UI::config()->canvas_colors.begin(); i != ARDOUR_UI::config()->canvas_colors.end(); i++) {
TreeModel::Row row = *(color_list->append());
@@ -262,3 +267,10 @@ ThemeManager::setup_theme ()
load_rc_file(rcfile, false);
}
+void
+ThemeManager::reset_canvas_colors()
+{
+ ARDOUR_UI::config()->load_defaults();
+ setup_theme ();
+}
+