Dim text rendered with ShadedPlusSign

This commit is contained in:
Robin Gareus
2022-01-31 01:58:42 +01:00
parent 0da02b582d
commit cc426b6d14

View File

@@ -1524,13 +1524,15 @@ ArdourWidgets::ArdourIcon::expose_with_text (GdkEventExpose* ev, Gtk::Widget* w,
gdk_cairo_rectangle (cr, &ev->area);
cairo_clip (cr);
int width = win->get_width ();
int height = win->get_height ();
int const width = win->get_width ();
int const height = win->get_height ();
Glib::RefPtr<Gtk::Style> style = w->get_style ();
Gdk::Color fg (style->get_fg (Gtk::STATE_NORMAL));
const uint32_t fg_color = RGBA_TO_UINT (fg.get_red () / 255., fg.get_green () / 255, fg.get_blue () / 255, 255);
Gdk::Color fg (style->get_fg (Gtk::STATE_NORMAL));
int const alpha = icon == ShadedPlusSign ? 0x80 : 0xff;
uint32_t fg_color = RGBA_TO_UINT (fg.get_red () / 255., fg.get_green () / 255, fg.get_blue () / 255, alpha);
Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (w->get_pango_context ());
layout->set_font_description (style->get_font ());
@@ -1553,6 +1555,8 @@ ArdourWidgets::ArdourIcon::expose_with_text (GdkEventExpose* ev, Gtk::Widget* w,
text_height = 0;
}
fg_color |= 0xff; /* restore alpha */
ArdourIcon::render (cr, icon, win->get_width (), win->get_height () - text_height, Gtkmm2ext::ExplicitActive, fg_color);
cairo_destroy (cr);