summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-07-29 19:58:04 +0200
committerraveit65 <[email protected]>2016-08-31 16:14:15 +0200
commite12d27ec69532e490a6b293cd44c11796b19b222 (patch)
tree0a3434153130254ce99a30b9f1485c2a9a8c40aa
parent7a70386db636b3e8953eb3d1987d5bacbe6f47a5 (diff)
downloadpluma-e12d27ec69532e490a6b293cd44c11796b19b222.tar.bz2
pluma-e12d27ec69532e490a6b293cd44c11796b19b222.tar.xz
GTK+-3 close button: style context fix
maybe i will drop this! taken from: https://git.gnome.org/browse/gedit/commit/?id=df3ce63
-rw-r--r--pluma/pluma-close-button.c19
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,