GNOME Bugzilla – Bug 732995
Add application-specific theme extensions
Last modified: 2014-07-12 03:23:04 UTC
This used to live in gnome-themes-standard, but with the move of Adwaita to GTK+, it needs to find a new home.
Created attachment 280390 [details] [review] Add application-specific theme extensions
Review of attachment 280390 [details] [review]: Other than the comment below, this looks pretty good to me. One thing I'm wondering is now that we have the concept of a "resource base path", whether GtkApplication should try to support this in a more automated way. For instance, if the GResource has a $themename.css file placed at a known path, it would automatically get loaded with the right priority, and removed/updated when the theme changes. ::: src/nautilus-application.c @@ +1161,3 @@ + static GtkCssProvider *provider; + + if (pspec == NULL || g_str_equal (pspec->name, "gtk-theme-name")) Why is this needed instead of just connecting to "notify::gtk-theme-name" on the settings?
See bug 732959 for discussion about automatic this more.
Created attachment 280446 [details] [review] Add application-specific theme extensions This used to live in gnome-themes-standard, but with the move of Adwaita to GTK+, it needs to find a new home.
I guess I was thinking about looking at ::gtk-application-prefer-dark in addition to ::gtk-theme-name when I wrote the code that way. But this works fine.
Review of attachment 280446 [details] [review]: OK, we can get this in until the more generic solution is implemented; in addition to the comments below could you also add a link to the GTK bug we have for the automatic solution? ::: src/nautilus-application.c @@ +1154,3 @@ } + static void Extra whitespace here @@ +1155,3 @@ + static void +theme_changed (GtkSettings *settings, Can make this function just take a GtkSettings @@ +1159,3 @@ + gpointer data) +{ + static GtkCssProvider *provider; Should be initialized to NULL, as you rely on it being NULL in the logic later @@ +1199,3 @@ + settings = gtk_settings_get_default (); + g_signal_connect (settings, "notify::gtk-theme-name", G_CALLBACK (theme_changed), NULL); + } This can be changed to remove the NULLs if you go with my suggestion above
*** Bug 732973 has been marked as a duplicate of this bug. ***
Thanks, pushed with the suggested changes. Attachment 280446 [details] pushed as 3fd7e84 - Add application-specific theme extensions