From c2025a62a6279db53a7cfe44d4e6e9eb115bdc44 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 12 Dec 2014 11:48:40 -0500 Subject: [PATCH] derive ArdourButton LED inactive color from active color, rather than requiring explicit definition --- gtk2_ardour/ardour_button.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 5a13dd751f..2e9646edbf 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -34,6 +34,7 @@ #include "ardour/rc_configuration.h" // for widget prelight preference #include "canvas/utils.h" +#include "canvas/colors.h" #include "ardour_button.h" #include "ardour_ui.h" @@ -680,10 +681,15 @@ ArdourButton::set_colors () 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"); - } + + /* The inactive color for the LED is just a fairly dark version of the + * active color. + */ + + ArdourCanvas::HSV inactive (led_active_color); + inactive.v = 0.35; + + led_inactive_color = inactive.color (); } /**