Commit c7de780e authored by Martin Blanchard's avatar Martin Blanchard

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.
parent 1cc72f64
Pipeline #68808 passed with stages
in 6 minutes and 45 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment