[gtk/theme-loading: 5/6] settings: Adapt to css provider api change



commit 4cfde0bdc826081857b22d29a277e6cd49bf9333
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed May 8 18:59:05 2019 +0000

    settings: Adapt to css provider api change
    
    Pass a fallback theme name instead of a variant.

 gtk/gtksettings.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index ad71dad94d..e33ef2e467 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -2208,17 +2208,27 @@ static void
 settings_update_theme (GtkSettings *settings)
 {
   GtkSettingsPrivate *priv = settings->priv;
-  gchar *theme_name;
-  gchar *theme_variant;
+  char *theme_name;
+  char *theme_variant;
+  char *theme_fallback;
 
   get_theme_name (settings, &theme_name, &theme_variant);
 
+  if (theme_variant)
+    {
+      theme_fallback = theme_name;
+      theme_name = g_strconcat (theme_fallback, "-", theme_variant, NULL);
+    }
+  else
+    theme_fallback = NULL;
+
   gtk_css_provider_load_named (priv->theme_provider,
                                theme_name,
-                               theme_variant);
+                               theme_fallback);
 
   g_free (theme_name);
   g_free (theme_variant);
+  g_free (theme_fallback);
 }
 
 const cairo_font_options_t *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]