[gnome-shell] networkAgent: Fix layout for RTL locales



commit 8abd18363cd84ce241d2c8185c6e9976f36f5778
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jun 20 16:41:22 2014 +0200

    networkAgent: Fix layout 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/components/networkAgent.js |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 181aa77..1a27fe6 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -77,6 +77,7 @@ const NetworkSecretDialog = new Lang.Class({
                                           layout_manager: layout });
         layout.hookup_style(secretTable);
 
+        let rtl = secretTable.get_text_direction() == Clutter.TextDirection.RTL;
         let initialFocusSet = false;
         let pos = 0;
         for (let i = 0; i < this._content.secrets.length; i++) {
@@ -116,10 +117,15 @@ const NetworkSecretDialog = new Lang.Class({
             } else
                 secret.valid = true;
 
-            layout.pack(label, 0, pos);
+            if (rtl) {
+                layout.pack(secret.entry, 0, pos);
+                layout.pack(label, 1, pos);
+            } else {
+                layout.pack(label, 0, pos);
+                layout.pack(secret.entry, 1, pos);
+            }
             layout.child_set(label, { x_expand: false, y_fill: false,
                                       x_align: Clutter.TableAlignment.START });
-            layout.pack(secret.entry, 1, pos);
             pos++;
 
             if (secret.password)


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