From d05572e14a1f95ed3da0c9ed2fde07f9c9c732da Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 14 Feb 2021 22:53:18 +0100 Subject: [PATCH] Fix round-corner backround of insensitive ArdourWidgets ArdourButton draws a custom insensitive background, using the color "gtk_background". This can conflict with gtk's insensitive background color when using round-corners. --- libs/gtkmm2ext/cairo_widget.cc | 4 ++-- libs/widgets/ardour_button.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/gtkmm2ext/cairo_widget.cc b/libs/gtkmm2ext/cairo_widget.cc index 7454149d5a..23533ea53f 100644 --- a/libs/gtkmm2ext/cairo_widget.cc +++ b/libs/gtkmm2ext/cairo_widget.cc @@ -297,7 +297,7 @@ CairoWidget::get_parent_bg () _current_parent = parent; _parent_style_change = parent->signal_style_changed().connect (mem_fun (*this, &CairoWidget::on_style_changed)); } - return style->get_bg (get_state()); + return style->get_bg (Gtk::STATE_NORMAL); } if (!parent->get_has_window()) { @@ -313,7 +313,7 @@ CairoWidget::get_parent_bg () _current_parent = parent; _parent_style_change = parent->signal_style_changed().connect (mem_fun (*this, &CairoWidget::on_style_changed)); } - return parent->get_style ()->get_bg (parent->get_state()); + return parent->get_style ()->get_bg (Gtk::STATE_NORMAL); } return get_style ()->get_bg (get_state()); diff --git a/libs/widgets/ardour_button.cc b/libs/widgets/ardour_button.cc index 8f0eb9bf02..5c3868a9e2 100644 --- a/libs/widgets/ardour_button.cc +++ b/libs/widgets/ardour_button.cc @@ -545,7 +545,7 @@ ArdourButton::render (Cairo::RefPtr const& ctx, cairo_rectangle_ // a transparent overlay to indicate insensitivity if ((visual_state() & Gtkmm2ext::Insensitive)) { - rounded_function (cr, 0, 0, get_width(), get_height(), corner_radius); + rounded_function (cr, 1, 1, get_width() - 2, get_height() - 2, corner_radius); uint32_t ins_color = UIConfigurationBase::instance().color ("gtk_background"); Gtkmm2ext::set_source_rgb_a (cr, ins_color, 0.6); cairo_fill (cr);