inspector: Look for themes in the right places

Match the places that GtkCssProvider looks in, so we show all
the themes that GTK+ would actually find.
This commit is contained in:
Matthias Clasen 2014-11-07 14:17:41 -05:00
parent af6eab850e
commit ee01ee249f

View File

@ -28,6 +28,7 @@
#include "gtksettings.h" #include "gtksettings.h"
#include "gtkswitch.h" #include "gtkswitch.h"
#include "gtkwindow.h" #include "gtkwindow.h"
#include "gtkcssproviderprivate.h"
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h" #include "x11/gdkx.h"
@ -196,7 +197,7 @@ get_data_path (const gchar *subdir)
{ {
gchar *base_datadir, *full_datadir; gchar *base_datadir, *full_datadir;
#if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) #if defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ)
base_datadir = g_strdup (_gtk_get_datadir()); base_datadir = g_strdup (_gtk_get_datadir ());
#else #else
base_datadir = g_strdup (GTK_DATADIR); base_datadir = g_strdup (GTK_DATADIR);
#endif #endif
@ -213,7 +214,7 @@ init_theme (GtkInspectorVisual *vis)
gchar *theme, *current_theme, *path; gchar *theme, *current_theme, *path;
gint i, pos; gint i, pos;
GSettings *settings; GSettings *settings;
gchar *themedir = get_data_path ("themes"); gchar *themedir;
t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
/* Builtin themes */ /* Builtin themes */
@ -221,15 +222,15 @@ init_theme (GtkInspectorVisual *vis)
g_hash_table_add (t, g_strdup ("HighContrast")); g_hash_table_add (t, g_strdup ("HighContrast"));
g_hash_table_add (t, g_strdup ("Raleigh")); g_hash_table_add (t, g_strdup ("Raleigh"));
fill_gtk (themedir, t); path = _gtk_css_provider_get_theme_dir ();
fill_gtk (path, t);
g_free (themedir); g_free (path);
path = g_build_filename (g_get_user_data_dir (), "themes", NULL); path = g_build_filename (g_get_user_data_dir (), "themes", NULL);
fill_gtk (path, t); fill_gtk (path, t);
g_free (path); g_free (path);
path = g_build_filename (g_get_home_dir (), "themes", NULL); path = g_build_filename (g_get_home_dir (), ".themes", NULL);
fill_gtk (path, t); fill_gtk (path, t);
g_free (path); g_free (path);