[libdazzle] css: tweak css provider fallback paths
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] css: tweak css provider fallback paths
- Date: Mon, 5 Jun 2017 09:28:07 +0000 (UTC)
commit c4bda4688daf1cf2140e5978e14f1228e5e77349
Author: Christian Hergert <chergert redhat com>
Date: Mon Jun 5 02:27:55 2017 -0700
css: tweak css provider fallback paths
First try theme+variant, then theme, then shared.css
src/theming/dzl-css-provider.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/theming/dzl-css-provider.c b/src/theming/dzl-css-provider.c
index bc89c4b..d0b73cc 100644
--- a/src/theming/dzl-css-provider.c
+++ b/src/theming/dzl-css-provider.c
@@ -83,14 +83,23 @@ dzl_css_provider_update (DzlCssProvider *self)
NULL);
}
+ /* First check with full path to theme+variant */
resource_path = g_strdup_printf ("%s/%s%s.css",
self->base_path,
theme_name, prefer_dark_theme ? "-dark" : "");
if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, &len, &flags, NULL))
{
+ /* Now try without the theme variant */
g_free (resource_path);
- resource_path = g_strdup_printf ("%s/shared.css", self->base_path);
+ resource_path = g_strdup_printf ("%s/%s.css", self->base_path, theme_name);
+
+ /* Now fallback to shared styling */
+ if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, &len, &flags, NULL))
+ {
+ g_free (resource_path);
+ resource_path = g_strdup_printf ("%s/shared.css", self->base_path);
+ }
}
/* Nothing to load */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]