diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-13 14:54:29 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-13 14:54:29 +0000 |
commit | faa729afb81cbe5976e8c6f64a8edb2865d5f2ce (patch) | |
tree | d27b0cb2d0e290e12368fc9eacd7e7e4fc963010 /gtk2_ardour | |
parent | 67adc8ceededd3f4464985d20b12e34746a833d9 (diff) |
improve button drawing when "implicit active uses solid color" tweak is on, and improve on the so-called "pepto-bismol" colors used for rec-enable buttons
git-svn-id: svn://localhost/ardour2/branches/3.0@13656 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour3_ui_default.conf | 4 | ||||
-rw-r--r-- | gtk2_ardour/ardour_button.cc | 36 |
2 files changed, 23 insertions, 17 deletions
diff --git a/gtk2_ardour/ardour3_ui_default.conf b/gtk2_ardour/ardour3_ui_default.conf index 1329e3bb59..0a3b8377ad 100644 --- a/gtk2_ardour/ardour3_ui_default.conf +++ b/gtk2_ardour/ardour3_ui_default.conf @@ -326,8 +326,8 @@ <Option name="record enable button: fill end" value="3d2828ff"/> <Option name="record enable button: fill start active" value="280b0bff"/> <Option name="record enable button: fill end active" value="b50e0eff"/> - <Option name="record enable button: led" value="00000000"/> - <Option name="record enable button: led active" value="fda0b1ff"/> + <Option name="record enable button: led" value="7b3541ff"/> + <Option name="record enable button: led active" value="90686fff"/> <Option name="record enable button: text" value="a5a5a5ff"/> <Option name="record enable button: text active" value="000000ff"/> <Option name="send alert button: fill start" value="4e5647ff"/> diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 796db0e1eb..a9eabd33d9 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -201,18 +201,15 @@ ArdourButton::render (cairo_t* cr) } if (active_state() == Gtkmm2ext::ImplicitActive) { - - if (_tweaks & ImplicitUsesSolidColor) { - // note: with this tweak, implicit-active - // background color uses "led active" color - UINT_TO_RGBA (fill_color_active, &r, &g, &b, &a); - cairo_set_source_rgba (cr, r/255.0, g/255.0, b/255.0, a/255.0); - cairo_fill (cr); - } else { - //background color + + if (!(_tweaks & ImplicitUsesSolidColor)) { cairo_set_source (cr, fill_pattern); - cairo_fill (cr); - + } else { + cairo_set_source (cr, fill_pattern_active); + } + cairo_fill (cr); + + if (!(_tweaks & ImplicitUsesSolidColor)) { //border UINT_TO_RGBA (fill_color_active, &r, &g, &b, &a); cairo_set_line_width (cr, 1.0); @@ -440,7 +437,7 @@ ArdourButton::set_colors () uint32_t text_color; uint32_t led_color; - if (_tweaks & ImplicitUsesSolidColor) { + if (active_state() == Gtkmm2ext::ImplicitActive && (_tweaks & ImplicitUsesSolidColor)) { fill_color_active = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led active", get_name())); } else { fill_color_active = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", get_name())); @@ -499,10 +496,19 @@ ArdourButton::set_colors () fill_pattern_active = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height()-3); if (_flat_buttons) { - end_color = start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", get_name())); + if (active_state() == Gtkmm2ext::ImplicitActive && (_tweaks & ImplicitUsesSolidColor)) { + end_color = start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led active", get_name())); + } else { + end_color = start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", get_name())); + } } else { - start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start active", get_name())); - end_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", get_name())); + if (active_state() == Gtkmm2ext::ImplicitActive && (_tweaks & ImplicitUsesSolidColor)) { + start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led", get_name())); + end_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led active", get_name())); + } else { + start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start active", get_name())); + end_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", get_name())); + } } UINT_TO_RGBA (start_color, &r, &g, &b, &a); cairo_pattern_add_color_stop_rgba (fill_pattern_active, 0, r/255.0,g/255.0,b/255.0, a/255.0); |