[gnome-shell] texture-cache: Use LTR/RTL icon lookup flags



commit e04e507659027a5bb6fed24871539cc6ce56b96f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Sep 5 09:56:21 2014 -0700

    texture-cache: Use LTR/RTL icon lookup flags

 js/ui/viewSelector.js     |    8 ++------
 src/st/st-texture-cache.c |   10 +++++++++-
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 88ef32c..e97627d 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -144,12 +144,8 @@ const ViewSelector = new Lang.Class({
 
         this._entry.set_primary_icon(new St.Icon({ style_class: 'search-entry-icon',
                                                    icon_name: 'edit-find-symbolic' }));
-        if (this._entry.get_text_direction() == Clutter.TextDirection.RTL)
-            this._clearIcon = new St.Icon({ style_class: 'search-entry-icon',
-                                            icon_name: 'edit-clear-symbolic-rtl' });
-        else
-            this._clearIcon = new St.Icon({ style_class: 'search-entry-icon',
-                                            icon_name: 'edit-clear-symbolic-ltr' });
+        this._clearIcon = new St.Icon({ style_class: 'search-entry-icon',
+                                        icon_name: 'edit-clear-symbolic' });
 
         this._iconClickedId = 0;
         this._capturedEventId = 0;
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index b99c0f8..c507c4b 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -893,11 +893,19 @@ load_gicon_with_colors (StTextureCache    *cache,
   GtkIconTheme *theme;
   GtkIconInfo *info;
   StTextureCachePolicy policy;
+  GtkIconLookupFlags lookup_flags;
 
   /* Do theme lookups in the main thread to avoid thread-unsafety */
   theme = cache->priv->icon_theme;
 
-  info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, icon, size, scale, GTK_ICON_LOOKUP_USE_BUILTIN);
+  lookup_flags = GTK_ICON_LOOKUP_USE_BUILTIN;
+
+  if (clutter_get_default_text_direction () == CLUTTER_TEXT_DIRECTION_RTL)
+    lookup_flags |= GTK_ICON_LOOKUP_DIR_RTL;
+  else
+    lookup_flags |= GTK_ICON_LOOKUP_DIR_LTR;
+
+  info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, icon, size, scale, lookup_flags);
   if (info == NULL)
     return NULL;
 


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