testicontheme: Use rtl/ltr lookup flags

This should help with diagnosing

https://bugzilla.gnome.org/show_bug.cgi?id=737000
This commit is contained in:
Matthias Clasen 2014-09-21 14:09:16 -04:00
parent ee9e708cf6
commit 39349cdea3

View File

@ -67,6 +67,7 @@ main (int argc, char *argv[])
GList *list; GList *list;
int size = 48; int size = 48;
int scale = 1; int scale = 1;
GtkIconLookupFlags flags;
gtk_init (&argc, &argv); gtk_init (&argc, &argv);
@ -76,6 +77,13 @@ main (int argc, char *argv[])
return 1; return 1;
} }
flags = GTK_ICON_LOOKUP_USE_BUILTIN;
if (g_getenv ("RTL"))
flags |= GTK_ICON_LOOKUP_DIR_RTL;
else
flags |= GTK_ICON_LOOKUP_DIR_LTR;
themename = argv[2]; themename = argv[2];
icon_theme = gtk_icon_theme_new (); icon_theme = gtk_icon_theme_new ();
@ -102,8 +110,7 @@ main (int argc, char *argv[])
scale = atoi (argv[5]); scale = atoi (argv[5]);
error = NULL; error = NULL;
pixbuf = gtk_icon_theme_load_icon_for_scale (icon_theme, argv[3], size, scale, pixbuf = gtk_icon_theme_load_icon_for_scale (icon_theme, argv[3], size, scale, flags, &error);
GTK_ICON_LOOKUP_USE_BUILTIN, &error);
if (!pixbuf) if (!pixbuf)
{ {
g_print ("%s\n", error->message); g_print ("%s\n", error->message);
@ -146,8 +153,7 @@ main (int argc, char *argv[])
G_CALLBACK (gtk_main_quit), window); G_CALLBACK (gtk_main_quit), window);
gtk_widget_show_all (window); gtk_widget_show_all (window);
info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, argv[3], size, scale, info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, argv[3], size, scale, flags);
GTK_ICON_LOOKUP_USE_BUILTIN);
if (info == NULL) if (info == NULL)
{ {
@ -201,7 +207,7 @@ main (int argc, char *argv[])
if (argc >= 6) if (argc >= 6)
scale = atoi (argv[5]); scale = atoi (argv[5]);
icon_info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, argv[3], size, scale, GTK_ICON_LOOKUP_USE_BUILTIN); icon_info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, argv[3], size, scale, flags);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_print ("icon for %s at %dx%d@%dx is %s\n", argv[3], size, size, scale, g_print ("icon for %s at %dx%d@%dx is %s\n", argv[3], size, size, scale,
icon_info ? (gtk_icon_info_get_builtin_pixbuf (icon_info) ? "<builtin>" : gtk_icon_info_get_filename (icon_info)) : "<none>"); icon_info ? (gtk_icon_info_get_builtin_pixbuf (icon_info) ? "<builtin>" : gtk_icon_info_get_filename (icon_info)) : "<none>");