[gnome-shell] keyboard: respect "center" alignment of keys



commit 32e8a9b3777a8540d12a77414bbf2fbc029e773e
Author: Daiki Ueno <ueno unixuser org>
Date:   Mon Aug 20 12:22:37 2012 +0900

    keyboard: respect "center" alignment of keys
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679925

 js/ui/keyboard.js |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 928d265..b77170f 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -302,18 +302,27 @@ const Keyboard = new Lang.Class({
         let keyboard_row = new St.BoxLayout();
         for (let i = 0; i < keys.length; ++i) {
             let children = keys[i].get_children();
-            let right_box = new St.BoxLayout({ style_class: 'keyboard-row' });
             let left_box = new St.BoxLayout({ style_class: 'keyboard-row' });
+            let center_box = new St.BoxLayout({ style_class: 'keyboard-row' });
+            let right_box = new St.BoxLayout({ style_class: 'keyboard-row' });
             for (let j = 0; j < children.length; ++j) {
                 if (this._numOfHorizKeys == 0)
                     this._numOfHorizKeys = children.length;
                 let key = children[j];
                 let button = new Key(key);
 
-                if (key.align == 'right')
+                switch (key.align) {
+                case 'right':
                     right_box.add(button.actor);
-                else
+                    break;
+                case 'center':
+                    center_box.add(button.actor);
+                    break;
+                case 'left':
+                default:
                     left_box.add(button.actor);
+                    break;
+                }
                 if (key.name == 'Caribou_Prefs') {
                     key.connect('key-released', Lang.bind(this, this.hide));
                 }
@@ -332,6 +341,7 @@ const Keyboard = new Lang.Class({
                 }));
             }
             keyboard_row.add(left_box, { expand: true, x_fill: false, x_align: St.Align.START });
+            keyboard_row.add(center_box, { expand: true, x_fill: false, x_align: St.Align.MIDDLE });
             keyboard_row.add(right_box, { expand: true, x_fill: false, x_align: St.Align.END });
         }
         layout.add(keyboard_row);


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