diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-01-21 10:54:49 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-01-21 10:56:47 +0100 |
commit | 10189e9b78af00a3a61457b296b992cd946ce4ab (patch) | |
tree | 884b6ea2e1b531cb69395af78c2c3286eaab14f2 | |
parent | f3ea3f0260f62426947238a28cbef79c1242ab9b (diff) | |
download | nautilus-10189e9b78af00a3a61457b296b992cd946ce4ab.tar.gz |
css: fix commit 7f0e1b0c6869eb
I pushed the unfinished patch in a wrong checkout.
Push the faulty bits needed to make it complete.
https://bugzilla.gnome.org/show_bug.cgi?id=760790
-rw-r--r-- | src/nautilus-application.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c index f9ae2cf36..75de58f8e 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -1099,6 +1099,7 @@ static void theme_changed (GtkSettings *settings) { static GtkCssProvider *provider = NULL; + static GtkCssProvider *permanent_provider = NULL; gchar *theme; GdkScreen *screen; GFile *file; @@ -1107,10 +1108,15 @@ theme_changed (GtkSettings *settings) screen = gdk_screen_get_default (); /* CSS we want to always load for any theme */ - provider = gtk_css_provider_new (); - file = g_file_new_for_uri ("resource:///org/gnome/nautilus/css/nautilus.css"); - gtk_css_provider_load_from_file (provider, file, NULL); - g_object_unref (file); + if (permanent_provider == NULL) { + permanent_provider = gtk_css_provider_new (); + file = g_file_new_for_uri ("resource:///org/gnome/nautilus/css/nautilus.css"); + gtk_css_provider_load_from_file (permanent_provider, file, NULL); + gtk_style_context_add_provider_for_screen (screen, + GTK_STYLE_PROVIDER (permanent_provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (file); + } /* CSS that themes can override */ if (g_str_equal (theme, "Adwaita")) |