After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732995 - Add application-specific theme extensions
Add application-specific theme extensions
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 732973 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-07-10 12:58 UTC by Matthias Clasen
Modified: 2014-07-12 03:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add application-specific theme extensions (5.19 KB, patch)
2014-07-10 12:58 UTC, Matthias Clasen
reviewed Details | Review
Add application-specific theme extensions (5.10 KB, patch)
2014-07-10 19:25 UTC, Matthias Clasen
committed Details | Review

Description Matthias Clasen 2014-07-10 12:58:15 UTC
This used to live in gnome-themes-standard, but with the move
of Adwaita to GTK+, it needs to find a new home.
Comment 1 Matthias Clasen 2014-07-10 12:58:18 UTC
Created attachment 280390 [details] [review]
Add application-specific theme extensions
Comment 2 Cosimo Cecchi 2014-07-10 17:41:24 UTC
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?
Comment 3 Matthias Clasen 2014-07-10 18:43:55 UTC
See bug 732959 for discussion about automatic this more.
Comment 4 Matthias Clasen 2014-07-10 19:25:27 UTC
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.
Comment 5 Matthias Clasen 2014-07-10 19:27:11 UTC
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.
Comment 6 Cosimo Cecchi 2014-07-10 21:27:13 UTC
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
Comment 7 António Fernandes 2014-07-11 09:06:37 UTC
*** Bug 732973 has been marked as a duplicate of this bug. ***
Comment 8 Matthias Clasen 2014-07-12 03:22:57 UTC
Thanks, pushed with the suggested changes.

Attachment 280446 [details] pushed as 3fd7e84 - Add application-specific theme extensions