[gtk+] Parse a per-theme settings.ini file
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Parse a per-theme settings.ini file
- Date: Thu, 27 Jan 2011 05:34:27 +0000 (UTC)
commit 55015693541003a765d3d1bb9bc2fbb8a2c0ff34
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jan 26 11:18:11 2011 -0500
Parse a per-theme settings.ini file
This lets themes override settings values again. We are using
the same priority that was used from the rc file parser, so things
are largely unchanged, relative to other settings sources.
gtk/gtksettings.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 6109d8c..3289b91 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -29,7 +29,7 @@
#include "gtkintl.h"
#include "gtkwidget.h"
#include "gtkprivate.h"
-#include "gtkcssprovider.h"
+#include "gtkcssproviderprivate.h"
#include "gtksymboliccolor.h"
#include "gtktypebuiltins.h"
#include "gtkversion.h"
@@ -2685,7 +2685,6 @@ settings_update_theme (GtkSettings *settings)
variant = "dark";
new_provider = gtk_css_provider_get_named (theme_name, variant);
- g_free (theme_name);
}
if (new_provider != provider)
@@ -2705,6 +2704,24 @@ settings_update_theme (GtkSettings *settings)
g_object_set_qdata_full (G_OBJECT (settings), quark_theme_name,
new_provider, (GDestroyNotify) g_object_unref);
}
+
+ if (theme_name && *theme_name)
+ {
+ gchar *theme_dir;
+ gchar *path;
+
+ /* reload per-theme settings */
+ theme_dir = _gtk_css_provider_get_theme_dir ();
+ path = g_build_filename (theme_dir, theme_name, "gtk-3.0", "settings.ini", NULL);
+
+ if (g_file_test (path, G_FILE_TEST_EXISTS))
+ gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_RC_FILE);
+
+ g_free (theme_dir);
+ g_free (path);
+ }
+
+ g_free (theme_name);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]