Reputation: 193
GtkStyle has been deprecated. I want to use GtkStyleContext instead (gtk_style_context_lookup_color) to find theme color.
I replaced successfully:
color = style->bg [GTK_STATE_SELECTED];
with:
gtk_style_context_lookup_color (context, "theme_selected_bg_color", &color)
but I do not know what color name to use to replace:
color = style->dark [GTK_STATE_NORMAL];
I need these colors to transfer them to a vumeter create with cairo:
gdk_cairo_set_source_rgba (cr, &color);
Upvotes: 5
Views: 2499
Reputation: 9183
as far as I know the list of color names is not part of GTK, but a property of the gtk theme. These are the color names for the default gnome theme, adwaita, for gtk 3.22: https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-22/gtk/theme/Adwaita/_colors-public.scss
I'm copying the names inline:
Upvotes: 4
Reputation: 6240
As I understand it, GTK does not allow you to create custom widgets that respects the current theme, so either
gtk_render_background
until you get something useful in a secondary cairo sufrace. See my answer to my own question: https://stackoverflow.com/a/44063175/877329Upvotes: 0