diff options
Diffstat (limited to 'libmate-desktop/mate-rr-labeler.c')
-rw-r--r-- | libmate-desktop/mate-rr-labeler.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libmate-desktop/mate-rr-labeler.c b/libmate-desktop/mate-rr-labeler.c index 346eb71..d0220ba 100644 --- a/libmate-desktop/mate-rr-labeler.c +++ b/libmate-desktop/mate-rr-labeler.c @@ -371,6 +371,26 @@ position_window (MateRRLabeler *labeler, gtk_window_move (GTK_WINDOW (window), workarea.x, workarea.y); } +static void +set_override_color (GtkWidget *widget, + GdkRGBA *rgba) +{ + gchar *css; + GtkCssProvider *provider; + + provider = gtk_css_provider_new (); + + css = g_strdup_printf ("* { color: %s;}", + gdk_rgba_to_string (rgba)); + gtk_css_provider_load_from_data (provider, css, -1, NULL); + g_free (css); + + gtk_style_context_add_provider (gtk_widget_get_style_context (widget), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (provider); +} + static GtkWidget * create_label_window (MateRRLabeler *labeler, MateRROutputInfo *output, GdkRGBA *color) { @@ -419,7 +439,7 @@ create_label_window (MateRRLabeler *labeler, MateRROutputInfo *output, GdkRGBA * * theme's colors, since the label is always shown against a light * pastel background. See bgo#556050 */ - gtk_widget_override_color (widget, gtk_widget_get_state_flags (widget), &black); + set_override_color (widget, &black); gtk_container_add (GTK_CONTAINER (window), widget); |