[gnome-shell] appDisplay: Fix folder icons for RTL locales



commit 2bda6db30fd7d4bb9ec847eef340dbe26cd1aa7f
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jun 20 17:46:22 2014 +0200

    appDisplay: Fix folder icons for RTL locales
    
    Unlike StTable, ClutterTableLayout does not take the actor's text
    direction into account, so mirror columns ourselves now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731923

 js/ui/appDisplay.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index d423129..b580ba3 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -953,6 +953,7 @@ const FolderView = new Lang.Class({
         let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size);
 
         let numItems = this._allItems.length;
+        let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL;
         for (let i = 0; i < 4; i++) {
             let bin;
             if (i < numItems) {
@@ -961,7 +962,7 @@ const FolderView = new Lang.Class({
             } else {
                 bin = new St.Bin({ width: subSize, height: subSize });
             }
-            layout.pack(bin, i % 2, Math.floor(i / 2));
+            layout.pack(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2));
         }
 
         return icon;


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