[gnome-settings-daemon] Support loading -rtl and -ltr variants of icons



commit e1494f09c3aa528e19357c22ce04a251695ccd77
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Nov 6 16:35:42 2009 +0000

    Support loading -rtl and -ltr variants of icons
    
    https://bugzilla.gnome.org/show_bug.cgi?id=600984

 plugins/media-keys/gsd-media-keys-window.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-window.c b/plugins/media-keys/gsd-media-keys-window.c
index 88b263e..3038885 100644
--- a/plugins/media-keys/gsd-media-keys-window.c
+++ b/plugins/media-keys/gsd-media-keys-window.c
@@ -750,7 +750,15 @@ render_custom (GsdMediaKeysWindow *window,
         pixbuf = load_pixbuf (window, window->priv->icon_name, icon_size);
 
         if (pixbuf == NULL) {
-                return FALSE;
+                char *name;
+                if (gtk_widget_get_direction (GTK_WIDGET (window)) == GTK_TEXT_DIR_RTL)
+                        name = g_strdup_printf ("%s-rtl", window->priv->icon_name);
+                else
+                        name = g_strdup_printf ("%s-ltr", window->priv->icon_name);
+                pixbuf = load_pixbuf (window, name, icon_size);
+                g_free (name);
+                if (pixbuf == NULL)
+                        return FALSE;
         }
 
         gdk_cairo_set_source_pixbuf (cr, pixbuf, _x0, _y0);



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