From aa7af8673a3d894fc99a00d1a30ea57f44e3e1c5 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 4 Dec 2016 15:23:03 -0500 Subject: Rename labels: follow theme if available, sane default Fixes https://github.com/mate-desktop/caja/issues/688 *Split caja.css. Much of it can load with GTK_STYLE_PROVIDER_PRIORITY_THEME to allow themes that support Caja to set their own style. CSS required for the desktop background to show and to keep the white text suitable for most backgrounds needs GTK_STYLE_PROVIDER_PRIORITY_APPLICATION so it is loaded separately from new file caja-desktop.css *Move all css items that must not be overridden by themes (most of them are for the desktop) to caja-desktop.css and keep those that are only needed when themes do not set them at all in caja.css --- src/caja-application.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/caja-application.c b/src/caja-application.c index bf8404d9..972b11b0 100644 --- a/src/caja-application.c +++ b/src/caja-application.c @@ -2215,6 +2215,20 @@ init_icons_and_styles (void) gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja.css", &error); + if (error != NULL) { + g_warning ("Can't parse Caja' CSS custom description: %s\n", error->message); + g_error_free (error); + } else { + gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_THEME); + } + +/* add our desktop CSS provider, ensures the desktop background does not get covered */ + provider = gtk_css_provider_new (); + gtk_css_provider_load_from_path (provider, + CAJA_DATADIR G_DIR_SEPARATOR_S "caja-desktop.css", &error); + if (error != NULL) { g_warning ("Can't parse Caja' CSS custom description: %s\n", error->message); g_error_free (error); @@ -2224,6 +2238,7 @@ init_icons_and_styles (void) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } + g_object_unref (provider); /* initialize search path for custom icons */ -- cgit v1.2.1