summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-12-11 17:04:21 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-12-11 17:04:21 -0500
commit75e6a36d8e471b0daaf3e3034c7e8080dfe2469d (patch)
tree5368f28697a6a8e9ae6016a8cef17e40e01507e7 /gtk2_ardour/ardour_button.cc
parentbd430c2080e24e624495858552c217d7bc9101a6 (diff)
fall back on "generic button" colors in ArdourButton if specifically named fills + LED colors are not defined
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r--gtk2_ardour/ardour_button.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index f4dbc830f6..5a13dd751f 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -662,15 +662,28 @@ ArdourButton::set_colors ()
return;
}
std::string name = get_name();
+ bool failed = false;
- fill_active_color = ARDOUR_UI::config()->color (string_compose ("%1: fill active", name));
- fill_inactive_color = ARDOUR_UI::config()->color (string_compose ("%1: fill", name));
+ fill_active_color = ARDOUR_UI::config()->color (string_compose ("%1: fill active", name), &failed);
+ if (failed) {
+ fill_active_color = ARDOUR_UI::config()->color ("generic button: fill active");
+ }
+ fill_inactive_color = ARDOUR_UI::config()->color (string_compose ("%1: fill", name), &failed);
+ if (failed) {
+ fill_inactive_color = ARDOUR_UI::config()->color ("generic button: fill");
+ }
text_active_color = ArdourCanvas::contrasting_text_color (fill_active_color);
text_inactive_color = ArdourCanvas::contrasting_text_color (fill_inactive_color);
- led_active_color = ARDOUR_UI::config()->color (string_compose ("%1: led active", name));
- led_inactive_color = ARDOUR_UI::config()->color (string_compose ("%1: led", name));
+ led_active_color = ARDOUR_UI::config()->color (string_compose ("%1: led active", name), &failed);
+ if (failed) {
+ led_active_color = ARDOUR_UI::config()->color ("generic button: led active");
+ }
+ led_inactive_color = ARDOUR_UI::config()->color (string_compose ("%1: led", name), &failed);
+ if (failed) {
+ led_inactive_color = ARDOUR_UI::config()->color ("generic button: led");
+ }
}
/**