ui: button: themable outline color instead of hard-coded black

This commit is contained in:
jean-emmanuel 2023-12-08 16:24:24 +01:00
parent 83c23f5f26
commit 08ad1af9dc
11 changed files with 17 additions and 1 deletions

View file

@ -130,6 +130,7 @@ ArdourButton::ArdourButton (const std::string& str, Element e, bool toggle)
, led_inactive_color(0)
, led_custom_color (0)
, use_custom_led_color (false)
, outline_color (0)
, convex_pattern (0)
, concave_pattern (0)
, led_inset_pattern (0)
@ -320,7 +321,7 @@ ArdourButton::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
// draw edge (filling a rect underneath, rather than stroking a border on top, allows the corners to be lighter-weight.
if ((_elements & (Body|Edge)) == (Body|Edge)) {
rounded_function (cr, 0, 0, get_width(), get_height(), corner_radius + 1.5);
cairo_set_source_rgba (cr, 0, 0, 0, 1);
Gtkmm2ext::set_source_rgba (cr, outline_color);
cairo_fill(cr);
}
@ -811,6 +812,9 @@ ArdourButton::set_colors ()
led_active_color = UIConfigurationBase::instance().color ("generic button: led active");
}
outline_color = UIConfigurationBase::instance().color ("generic button: outline");
/* The inactive color for the LED is just a fairly dark version of the
* active color.
*/

View file

@ -195,6 +195,9 @@ class LIBWIDGETS_API ArdourButton : public CairoWidget , public Gtkmm2ext::Activ
uint32_t led_custom_color;
bool use_custom_led_color;
uint32_t outline_color;
cairo_pattern_t* convex_pattern;
cairo_pattern_t* concave_pattern;
cairo_pattern_t* led_inset_pattern;