Skip to content

Commit 43b16f7

Browse files
committed
Weather: apply a widget name to the textview
This is necessary to allow use of gtk_style_context_add_provider_for_screen without applying the provider to other applets too if these applets are ever ported to run in-process.
1 parent 1cd86c7 commit 43b16f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mateweather/mateweather-dialog.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,12 @@ override_widget_font (GtkWidget *widget,
535535

536536
provider = gtk_css_provider_get_default ();
537537

538-
css = g_strdup_printf ("textview { %s %s %s %s }", family, weight, style, size);
538+
gtk_widget_set_name(GTK_WIDGET(widget), "MateWeatherAppletTextView");
539+
css = g_strdup_printf ("#MateWeatherAppletTextView { %s %s %s %s }", family, weight, style, size);
539540
gtk_css_provider_load_from_data (provider, css, -1, NULL);
540541

541542
if (!provider_added) {
542-
gtk_style_context_add_provider(gtk_widget_get_style_context(GTK_WIDGET(widget)),
543+
gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (widget),
543544
GTK_STYLE_PROVIDER (provider),
544545
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
545546
provider_added = TRUE;

0 commit comments

Comments
 (0)