gtk_style_context_lookup_color() replacement
So while gtk_style_context_get_color() has a replacement in GtkWidget, lookup_color() doesn't.
This is a problem because there are quite a few use cases that need it atm.
For example:
- Drawing symbolic icons:
gtk_style_context_get_color (context, &colors[GTK_SYMBOLIC_COLOR_FOREGROUND]);
gtk_style_context_lookup_color (context, "error-color", &colors[GTK_SYMBOLIC_COLOR_ERROR]);
gtk_style_context_lookup_color (context, "warning-color", &colors[GTK_SYMBOLIC_COLOR_WARNING]);
gtk_style_context_lookup_color (context, "success-color", &colors[GTK_SYMBOLIC_COLOR_SUCCESS]);
Where else would one get colors to pass to gtk_symbolic_paintable_snapshot_symbolic()
?
-
Sound recorder waveform is custom drawn, yet needs to fetch the accent/destructive colors for the center line.
-
AdwTabOverview
transition uses custom drawing. It can't use a widget because it needs fractional sizing to avoid jitter (since it's continuously resizing), so it needs to get all of the css colors itself.
So I think for GTK4 - while CSS named colors exist and are the only way to do this - I think there should be a non-deprecated way to use it.