diff options
-rw-r--r-- | pluma/pluma-close-button.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/pluma/pluma-close-button.c b/pluma/pluma-close-button.c index 4a4286e5..3fab3e35 100644 --- a/pluma/pluma-close-button.c +++ b/pluma/pluma-close-button.c @@ -34,7 +34,6 @@ static void pluma_close_button_init (PlumaCloseButton *button) { GtkWidget *image; - GtkStyleContext *context; GtkCssProvider *css; GError *error = NULL; const gchar button_style[] = @@ -57,17 +56,21 @@ pluma_close_button_init (PlumaCloseButton *button) /* make it as small as possible */ css = gtk_css_provider_new (); - if (!gtk_css_provider_load_from_data (css, button_style, - -1, &error)) + if (gtk_css_provider_load_from_data (css, button_style, + -1, &error)) + { + GtkStyleContext *context; + + context = gtk_widget_get_style_context (GTK_WIDGET (button)); + gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (css), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (css); + } + else { g_warning ("%s", error->message); g_error_free (error); } - - context = gtk_widget_get_style_context (GTK_WIDGET (button)); - gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (css), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); - g_object_unref (css); } #else pluma_close_button_style_set (GtkWidget *button, |