[gedit/tchaik/adwaita-css-fallback] theme: Always use Adwaita specifics as fallback
- From: Martin Blanchard <mablanch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/tchaik/adwaita-css-fallback] theme: Always use Adwaita specifics as fallback
- Date: Sun, 17 Mar 2019 13:38:54 +0000 (UTC)
commit c7de780ebe9dcf32db95f9462d0cb805a83e0665
Author: Martin Blanchard <tchaik gmx com>
Date: Sun Mar 17 13:00:32 2019 +0000
theme: Always use Adwaita specifics as fallback
Load shared and OS specific CSS resources first and fallback to Adwaita
if no other theme specifics are found.
gedit/gedit-app.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 24693e585..a09709ed4 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -678,6 +678,7 @@ theme_changed (GtkSettings *settings,
GeditApp *app)
{
GeditAppPrivate *priv;
+ GtkCssProvider *theme_provider;
priv = gedit_app_get_instance_private (app);
@@ -697,7 +698,13 @@ theme_changed (GtkSettings *settings,
g_clear_object (&priv->theme_provider);
}
- priv->theme_provider = load_css_from_resource (theme_css, FALSE);
+ theme_provider = load_css_from_resource (theme_css, FALSE);
+ if (theme_provider == NULL)
+ {
+ theme_provider = load_css_from_resource ("gedit.adwaita.css", TRUE);
+ }
+
+ priv->theme_provider = theme_provider;
g_free (theme_css);
}
@@ -754,7 +761,6 @@ static void
gedit_app_startup (GApplication *application)
{
GeditAppPrivate *priv;
- GtkCssProvider *css_provider;
GtkSourceStyleSchemeManager *manager;
#ifndef ENABLE_GVFS_METADATA
const gchar *cache_dir;
@@ -769,8 +775,6 @@ gedit_app_startup (GApplication *application)
gedit_debug_init ();
gedit_debug_message (DEBUG_APP, "Startup");
- setup_theme_extensions (GEDIT_APP (application));
-
#ifndef ENABLE_GVFS_METADATA
cache_dir = gedit_dirs_get_user_cache_dir ();
metadata_filename = g_build_filename (cache_dir, "gedit-metadata.xml", NULL);
@@ -838,8 +842,9 @@ gedit_app_startup (GApplication *application)
/* Load custom css */
g_object_unref (load_css_from_resource ("gedit-style.css", TRUE));
- css_provider = load_css_from_resource ("gedit-style-os.css", FALSE);
- g_clear_object (&css_provider);
+ g_object_unref (load_css_from_resource ("gedit-style-os.css", FALSE));
+
+ setup_theme_extensions (GEDIT_APP (application));
/*
* We use the default gtksourceview style scheme manager so that plugins
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]