[gnome-shell] js: Use generic actor properties to align StBin children



commit f2bd39b20c89c1896c124f1dccdd587aa544e45c
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Oct 17 23:40:24 2019 +0200

    js: Use generic actor properties to align StBin children
    
    StBin's fill/align properties are now no-ops; get back the intended
    child allocation by setting the corresponding x/y-align on the child.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/803

 js/gdm/authPrompt.js               |  3 +--
 js/gdm/loginDialog.js              | 28 ++++++++++++++++------------
 js/ui/altTab.js                    | 13 +++++++------
 js/ui/appDisplay.js                | 35 +++++++++++++++++------------------
 js/ui/calendar.js                  |  6 +++---
 js/ui/checkBox.js                  |  7 ++++---
 js/ui/components/autorunManager.js | 15 +++++++++------
 js/ui/dash.js                      |  9 ++++++---
 js/ui/dateMenu.js                  | 14 ++++++++------
 js/ui/iconGrid.js                  | 13 +++++++------
 js/ui/keyboard.js                  |  5 +----
 js/ui/lookingGlass.js              | 14 ++++++++------
 js/ui/magnifier.js                 |  2 +-
 js/ui/messageList.js               | 14 +++++++-------
 js/ui/messageTray.js               |  3 +--
 js/ui/modalDialog.js               |  9 ++++++---
 js/ui/overview.js                  |  2 +-
 js/ui/padOsd.js                    | 14 +++++++-------
 js/ui/panelMenu.js                 | 10 ++++++----
 js/ui/popupMenu.js                 | 20 +++++++++-----------
 js/ui/screenShield.js              | 13 ++++++-------
 js/ui/search.js                    | 23 +++++++++++++++--------
 js/ui/shellMountOperation.js       | 12 ++++++------
 js/ui/unlockDialog.js              |  4 +---
 js/ui/viewSelector.js              |  7 ++-----
 25 files changed, 155 insertions(+), 140 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 8a93123496..c5d93c946e 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -88,8 +88,6 @@ var AuthPrompt = GObject.registerClass({
         this.connect('destroy', this._onDestroy.bind(this));
 
         this._userWell = new St.Bin({
-            x_fill: true,
-            x_align: St.Align.START,
             x_expand: true,
             y_expand: true,
         });
@@ -447,6 +445,7 @@ var AuthPrompt = GObject.registerClass({
 
         if (user) {
             let userWidget = new UserWidget.UserWidget(user);
+            userWidget.x_align = Clutter.ActorAlign.START;
             this._userWell.set_child(userWidget);
         }
     }
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 5b40405d7a..96d8453b70 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -42,7 +42,10 @@ var UserListItem = GObject.registerClass({
     Signals: { 'activate': {} }
 }, class UserListItem extends St.Button {
     _init(user) {
-        let layout = new St.BoxLayout({ vertical: true });
+        let layout = new St.BoxLayout({
+            vertical: true,
+            x_align: Clutter.ActorAlign.START,
+        });
         super._init({
             style_class: 'login-dialog-user-list-item',
             button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
@@ -50,8 +53,6 @@ var UserListItem = GObject.registerClass({
             x_expand: true,
             child: layout,
             reactive: true,
-            x_align: St.Align.START,
-            x_fill: true
         });
 
         this.user = user;
@@ -456,15 +457,18 @@ var LoginDialog = GObject.registerClass({
         // translators: this message is shown below the user list on the
         // login screen. It can be activated to reveal an entry for
         // manually entering the username.
-        let notListedLabel = new St.Label({ text: _("Not listed?"),
-                                            style_class: 'login-dialog-not-listed-label' });
-        this._notListedButton = new St.Button({ style_class: 'login-dialog-not-listed-button',
-                                                button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
-                                                can_focus: true,
-                                                child: notListedLabel,
-                                                reactive: true,
-                                                x_align: St.Align.START,
-                                                x_fill: true });
+        let notListedLabel = new St.Label({
+            text: _("Not listed?"),
+            style_class: 'login-dialog-not-listed-label',
+            x_align: Clutter.ActorAlign.START,
+        });
+        this._notListedButton = new St.Button({
+            style_class: 'login-dialog-not-listed-button',
+            button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
+            can_focus: true,
+            child: notListedLabel,
+            reactive: true,
+        });
 
         this._notListedButton.connect('clicked', 
this._hideUserListAskForUsernameAndBeginVerification.bind(this));
 
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index 3ec807c494..1c4a239984 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -655,7 +655,7 @@ class AppIcon extends St.BoxLayout {
 
         this.app = app;
         this.icon = null;
-        this._iconBin = new St.Bin({ x_fill: true, y_fill: true });
+        this._iconBin = new St.Bin();
 
         this.add_child(this._iconBin);
         this.label = new St.Label({
@@ -894,12 +894,13 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
 
             let title = windows[i].get_title();
             if (title) {
-                let name = new St.Label({ text: title });
-                // St.Label doesn't support text-align so use a Bin
-                let bin = new St.Bin({ x_align: St.Align.MIDDLE });
+                let name = new St.Label({
+                    text: title,
+                    // St.Label doesn't support text-align
+                    x_align: Clutter.ActorAlign.CENTER,
+                });
                 this._labels.push(bin);
-                bin.add_actor(name);
-                box.add_actor(bin);
+                box.add_actor(name);
 
                 this.addItem(box, name);
             } else {
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index ee0beabe97..43b1860f80 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -305,10 +305,7 @@ var AllView = GObject.registerClass({
         this._scrollView = new St.ScrollView({ style_class: 'all-apps',
                                                x_expand: true,
                                                y_expand: true,
-                                               x_fill: true,
-                                               y_fill: false,
-                                               reactive: true,
-                                               y_align: St.Align.START });
+                                               reactive: true, });
         this.add_actor(this._scrollView);
         this._grid._delegate = this;
 
@@ -327,7 +324,10 @@ var AllView = GObject.registerClass({
         this.folderIcons = [];
 
         this._stack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
-        let box = new St.BoxLayout({ vertical: true });
+        let box = new St.BoxLayout({
+            vertical: true,
+            y_align: Clutter.ActorAlign.START,
+        });
 
         this._grid.currentPage = 0;
         this._stack.add_actor(this._grid);
@@ -1046,8 +1046,11 @@ class AppDisplay extends St.BoxLayout {
         this._viewStackLayout.connect('allocated-size-changed', this._onAllocatedSizeChanged.bind(this));
         this.add_actor(this._viewStack);
         let layout = new ControlsBoxLayout({ homogeneous: true });
-        this._controls = new St.Widget({ style_class: 'app-view-controls',
-                                         layout_manager: layout });
+        this._controls = new St.Widget({
+            style_class: 'app-view-controls',
+            layout_manager: layout,
+            x_align: Clutter.ActorAlign.CENTER,
+        });
         this._controls.connect('notify::mapped', () => {
             // controls are faded either with their parent or
             // explicitly in animate(); we can't know how they'll be
@@ -1266,15 +1269,18 @@ class FolderView extends BaseAppView {
 
         this._scrollView = new St.ScrollView({
             overlay_scrollbars: true,
-            x_fill: true,
-            y_fill: true,
             x_expand: true,
             y_expand: true
         });
         this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         this.add_actor(this._scrollView);
 
-        let scrollableContainer = new St.BoxLayout({ vertical: true, reactive: true });
+        let scrollableContainer = new St.BoxLayout({
+            vertical: true,
+            reactive: true,
+            x_expand: true,
+            y_expand: true,
+        });
         scrollableContainer.add_actor(this._grid);
         this._scrollView.add_actor(scrollableContainer);
 
@@ -1462,8 +1468,6 @@ var FolderIcon = GObject.registerClass({
             button_mask: St.ButtonMask.ONE,
             toggle_mode: true,
             can_focus: true,
-            x_fill: true,
-            y_fill: true
         });
         this.id = id;
         this.name = '';
@@ -1902,10 +1906,7 @@ var AppFolderPopup = GObject.registerClass({
 
         this._boxPointer = new BoxPointer.BoxPointer(this._arrowSide,
                                                      { style_class: 'app-folder-popup-bin',
-                                                       x_fill: true,
-                                                       y_fill: true,
-                                                       x_expand: true,
-                                                       x_align: St.Align.START });
+                                                       x_expand: true, });
 
         this._boxPointer.style_class = 'app-folder-popup';
         this.add_actor(this._boxPointer);
@@ -2057,8 +2058,6 @@ var AppIcon = GObject.registerClass({
             reactive: true,
             button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO,
             can_focus: true,
-            x_fill: true,
-            y_fill: true
         });
 
         this.app = app;
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index c187e96d37..81bfc1fd11 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -790,8 +790,8 @@ class EventsSection extends MessageList.MessageListSection {
 
         this._title = new St.Button({ style_class: 'events-section-title',
                                       label: '',
-                                      x_align: St.Align.START,
                                       can_focus: true });
+        this._title.child.x_align = Clutter.ActorAlign.START;
         this.insert_child_below(this._title, null);
 
         this._title.connect('clicked', this._onTitleClicked.bind(this));
@@ -1078,8 +1078,7 @@ class CalendarMessageList extends St.Widget {
 
         this._scrollView = new St.ScrollView({ style_class: 'vfade',
                                                overlay_scrollbars: true,
-                                               x_expand: true, y_expand: true,
-                                               x_fill: true, y_fill: true });
+                                               x_expand: true, y_expand: true, });
         this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         box.add_actor(this._scrollView);
 
@@ -1098,6 +1097,7 @@ class CalendarMessageList extends St.Widget {
 
         this._sectionList = new St.BoxLayout({ style_class: 'message-list-sections',
                                                vertical: true,
+                                               x_expand: true,
                                                y_expand: true,
                                                y_align: Clutter.ActorAlign.START });
         this._sectionList.connect('actor-added', this._sync.bind(this));
diff --git a/js/ui/checkBox.js b/js/ui/checkBox.js
index c4683e0e54..a58e6dbd4b 100644
--- a/js/ui/checkBox.js
+++ b/js/ui/checkBox.js
@@ -11,11 +11,12 @@ class CheckBox extends St.Button {
             button_mask: St.ButtonMask.ONE,
             toggle_mode: true,
             can_focus: true,
-            x_fill: true,
-            y_fill: true
         });
 
-        this._box = new St.Bin();
+        this._box = new St.Bin({
+            x_expand: true,
+            y_expand: true,
+        });
         this._box.set_y_align(Clutter.ActorAlign.START);
         container.add_actor(this._box);
 
diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js
index 41e316330f..82f8b9ecb0 100644
--- a/js/ui/components/autorunManager.js
+++ b/js/ui/components/autorunManager.js
@@ -1,7 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported Component */
 
-const { Gio, GObject, St } = imports.gi;
+const { Clutter, Gio, GObject, St } = imports.gi;
 
 const GnomeSession = imports.misc.gnomeSession;
 const Main = imports.ui.main;
@@ -320,20 +320,23 @@ class AutorunNotification extends MessageTray.Notification {
     }
 
     _buttonForApp(app) {
-        let box = new St.BoxLayout();
+        let box = new St.BoxLayout({
+            x_expand: true,
+            x_align: Clutter.ActorAlign.START,
+        });
         let icon = new St.Icon({ gicon: app.get_icon(),
                                  style_class: 'hotplug-notification-item-icon' });
         box.add(icon);
 
         let label = new St.Bin({
-            y_align: St.Align.MIDDLE,
-            child: new St.Label({ text: _("Open with %s").format(app.get_name()) }),
+            child: new St.Label({
+                text: _("Open with %s").format(app.get_name()),
+                y_align: Clutter.ActorAlign.CENTER,
+            }),
         });
         box.add(label);
 
         let button = new St.Button({ child: box,
-                                     x_fill: true,
-                                     x_align: St.Align.START,
                                      x_expand: true,
                                      button_mask: St.ButtonMask.ONE,
                                      style_class: 'hotplug-notification-item button' });
diff --git a/js/ui/dash.js b/js/ui/dash.js
index e22cbfbb3d..b033eb2ac7 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -285,9 +285,12 @@ var DashActor = GObject.registerClass(
 class DashActor extends St.Widget {
     _init() {
         let layout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.VERTICAL });
-        super._init({ name: 'dash',
-                      layout_manager: layout,
-                      clip_to_allocation: true });
+        super._init({
+            name: 'dash',
+            layout_manager: layout,
+            clip_to_allocation: true,
+            y_align: Clutter.ActorAlign.CENTER,
+        });
     }
 
     vfunc_allocate(box, flags) {
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 665fa433e2..960c5f4bdd 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -37,7 +37,6 @@ class TodayButton extends St.Button {
         // until the selected date changes.
         super._init({
             style_class: 'datemenu-today-button',
-            x_align: St.Align.START,
             x_expand: true,
             can_focus: true,
             reactive: false
@@ -90,7 +89,6 @@ class WorldClocksSection extends St.Button {
     _init() {
         super._init({
             style_class: 'world-clocks-button',
-            x_fill: true,
             can_focus: true,
             x_expand: true,
         });
@@ -101,6 +99,7 @@ class WorldClocksSection extends St.Button {
 
         let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
         this._grid = new St.Widget({ style_class: 'world-clocks-grid',
+                                     x_expand: true,
                                      layout_manager: layout });
         layout.hookup_style(this._grid);
 
@@ -253,15 +252,17 @@ class WeatherSection extends St.Button {
     _init() {
         super._init({
             style_class: 'weather-button',
-            x_fill: true,
             can_focus: true,
             x_expand: true,
         });
 
         this._weatherClient = new Weather.WeatherClient();
 
-        let box = new St.BoxLayout({ style_class: 'weather-box',
-                                     vertical: true });
+        let box = new St.BoxLayout({
+            style_class: 'weather-box',
+            vertical: true,
+            x_expand: true,
+        });
 
         this.child = box;
 
@@ -582,12 +583,13 @@ class DateMenuButton extends PanelMenu.Button {
         vbox.add_actor(this._calendar);
 
         this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade',
-                                                    x_expand: true, x_fill: true,
+                                                    x_expand: true,
                                                     overlay_scrollbars: true });
         this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
         vbox.add_actor(this._displaysSection);
 
         let displaysBox = new St.BoxLayout({ vertical: true,
+                                             x_expand: true,
                                              style_class: 'datemenu-displays-box' });
         this._displaysSection.add_actor(displaysBox);
 
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 782756947b..74aac7ad33 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -39,18 +39,19 @@ class BaseIcon extends St.Bin {
         if (params.showLabel)
             styleClass += ' overview-icon-with-label';
 
-        super._init({ style_class: styleClass,
-                      x_fill: true,
-                      y_fill: true });
+        super._init({ style_class: styleClass });
 
         this.connect('destroy', this._onDestroy.bind(this));
 
-        this._box = new St.BoxLayout({ vertical: true });
+        this._box = new St.BoxLayout({
+            vertical: true,
+            x_expand: true,
+            y_expand: true,
+        });
         this.set_child(this._box);
 
         this.iconSize = ICON_SIZE;
-        this._iconBin = new St.Bin({ x_align: St.Align.MIDDLE,
-                                     y_align: St.Align.MIDDLE });
+        this._iconBin = new St.Bin();
 
         this._box.add_actor(this._iconBin);
 
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 7cdb60d945..e12d83a968 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -292,10 +292,7 @@ var Key = GObject.registerClass({
         if (this._extended_keys.length == 0)
             return;
 
-        this._boxPointer = new BoxPointer.BoxPointer(St.Side.BOTTOM,
-                                                     { x_fill: true,
-                                                       y_fill: true,
-                                                       x_align: St.Align.START });
+        this._boxPointer = new BoxPointer.BoxPointer(St.Side.BOTTOM);
         this._boxPointer.hide();
         Main.layoutManager.addTopChrome(this._boxPointer);
         this._boxPointer.setPosition(this.keyButton, 0.5);
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 9238cb82e9..922ed988eb 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -264,7 +264,7 @@ class ObjLink extends St.Button {
             reactive: true,
             track_hover: true,
             style_class: 'shell-link',
-            label: text
+            label: text,
         });
         this.set_x_align(Clutter.ActorAlign.START);
         this.get_child().single_line_mode = true;
@@ -359,8 +359,6 @@ class ObjInspector extends St.ScrollView {
     _init(lookingGlass) {
         super._init({
             pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
-            x_fill: true,
-            y_fill: true
         });
 
         this._obj = null;
@@ -369,9 +367,13 @@ class ObjInspector extends St.ScrollView {
         this._parentList = [];
 
         this.get_hscroll_bar().hide();
-        this._container = new St.BoxLayout({ name: 'LookingGlassPropertyInspector',
-                                             style_class: 'lg-dialog',
-                                             vertical: true });
+        this._container = new St.BoxLayout({
+            name: 'LookingGlassPropertyInspector',
+            style_class: 'lg-dialog',
+            vertical: true,
+            x_expand: true,
+            y_expand: true,
+        });
         this.add_actor(this._container);
 
         this._lookingGlass = lookingGlass;
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 316abc6bf0..191784c209 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -1278,7 +1278,7 @@ var ZoomRegion = class ZoomRegion {
 
     _createActors() {
         // The root actor for the zoom region
-        this._magView = new St.Bin({ style_class: 'magnifier-zoom-region', x_fill: true, y_fill: true });
+        this._magView = new St.Bin({ style_class: 'magnifier-zoom-region' });
         global.stage.add_actor(this._magView);
 
         // hide the magnified region from CLUTTER_PICK_ALL
diff --git a/js/ui/messageList.js b/js/ui/messageList.js
index 5cac1de75c..06fa11e212 100644
--- a/js/ui/messageList.js
+++ b/js/ui/messageList.js
@@ -307,13 +307,16 @@ var Message = GObject.registerClass({
             accessible_role: Atk.Role.NOTIFICATION,
             can_focus: true,
             x_expand: true,
-            x_fill: true
+            y_expand: true,
         });
 
         this.expanded = false;
         this._useBodyMarkup = false;
 
-        let vbox = new St.BoxLayout({ vertical: true });
+        let vbox = new St.BoxLayout({
+            vertical: true,
+            x_expand: true,
+        });
         this.set_child(vbox);
 
         let hbox = new St.BoxLayout();
@@ -325,7 +328,7 @@ var Message = GObject.registerClass({
 
         this._iconBin = new St.Bin({ style_class: 'message-icon-bin',
                                      y_expand: true,
-                                     y_align: St.Align.START,
+                                     y_align: Clutter.ActorAlign.START,
                                      visible: false });
         hbox.add_actor(this._iconBin);
 
@@ -344,8 +347,7 @@ var Message = GObject.registerClass({
         titleBox.add_actor(this.titleLabel);
 
         this._secondaryBin = new St.Bin({ style_class: 'message-secondary-bin',
-                                          x_expand: true, y_expand: true,
-                                          x_fill: true, y_fill: true });
+                                          x_expand: true, y_expand: true, });
         titleBox.add_actor(this._secondaryBin);
 
         let closeIcon = new St.Icon({ icon_name: 'window-close-symbolic',
@@ -605,8 +607,6 @@ var MessageListSection = GObject.registerClass({
 
         let listItem = new St.Bin({
             child: message,
-            x_fill: true,
-            y_fill: true,
             layout_manager: new ScaleLayout(),
             pivot_point: new Graphene.Point({ x: .5, y: .5 }),
         });
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 2ec8a14f42..0c738fd55b 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -632,8 +632,7 @@ class SourceActor extends St.Widget {
         this._actorDestroyed = false;
 
         let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
-        this._iconBin = new St.Bin({ x_fill: true,
-                                     x_expand: true,
+        this._iconBin = new St.Bin({ x_expand: true,
                                      height: size * scaleFactor,
                                      width: size * scaleFactor });
 
diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index 1f7c481e1c..f357744075 100644
--- a/js/ui/modalDialog.js
+++ b/js/ui/modalDialog.js
@@ -57,9 +57,12 @@ var ModalDialog = GObject.registerClass({
                                                       coordinate: Clutter.BindCoordinate.ALL });
         this.add_constraint(constraint);
 
-        this.backgroundStack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
-        this._backgroundBin = new St.Bin({ child: this.backgroundStack,
-                                           x_fill: true, y_fill: true });
+        this.backgroundStack = new St.Widget({
+            layout_manager: new Clutter.BinLayout(),
+            x_expand: true,
+            y_expand: true,
+        });
+        this._backgroundBin = new St.Bin({ child: this.backgroundStack });
         this._monitorConstraint = new Layout.MonitorConstraint();
         this._backgroundBin.add_constraint(this._monitorConstraint);
         this.add_actor(this._backgroundBin);
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 6798ee3645..e09f523be5 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -111,7 +111,7 @@ class OverviewActor extends St.BoxLayout {
         this._searchEntry.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
         let searchEntryBin = new St.Bin({
             child: this._searchEntry,
-            x_align: St.Align.MIDDLE
+            x_align: Clutter.ActorAlign.CENTER,
         });
         this.add_actor(searchEntryBin);
 
diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js
index c16e93d017..88dd61a687 100644
--- a/js/ui/padOsd.js
+++ b/js/ui/padOsd.js
@@ -29,17 +29,17 @@ var PadChooser = GObject.registerClass({
         super._init({
             style_class: 'pad-chooser-button',
             toggle_mode: true,
-            x_fill: false,
-            y_fill: false,
-            x_align: St.Align.MIDDLE,
-            y_align: St.Align.MIDDLE
         });
         this.currentDevice = device;
         this._padChooserMenu = null;
 
-        let arrow = new St.Icon({ style_class: 'popup-menu-arrow',
-                                  icon_name: 'pan-down-symbolic',
-                                  accessible_role: Atk.Role.ARROW });
+        let arrow = new St.Icon({
+            style_class: 'popup-menu-arrow',
+            icon_name: 'pan-down-symbolic',
+            accessible_role: Atk.Role.ARROW,
+            x_align: Clutter.ActorAlign.CENTER,
+            y_align: Clutter.ActorAlign.CENTER,
+        });
         this.set_child(arrow);
         this._ensureMenu(groupDevices);
 
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 8c4c26423f..cbb10e5385 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -10,15 +10,17 @@ const PopupMenu = imports.ui.popupMenu;
 var ButtonBox = GObject.registerClass(
 class ButtonBox extends St.Widget {
     _init(params) {
-        params = Params.parse(params, { style_class: 'panel-button' }, true);
+        params = Params.parse(params, {
+            style_class: 'panel-button',
+            x_expand: true,
+            y_expand: true,
+        }, true);
 
         super._init(params);
 
         this._delegate = this;
 
-        this.container = new St.Bin({ y_fill: true,
-                                      x_fill: true,
-                                      child: this });
+        this.container = new St.Bin({ child: this });
 
         this.connect('style-changed', this._onStyleChanged.bind(this));
         this.connect('destroy', this._onDestroy.bind(this));
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index e96aea8c67..fc7db59256 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -340,7 +340,6 @@ var PopupSwitchMenuItem = GObject.registerClass({
         this.add_child(this.label);
 
         this._statusBin = new St.Bin({
-            x_align: St.Align.END,
             x_expand: true,
         });
         this._statusBin.set_x_align(Clutter.ActorAlign.END);
@@ -442,12 +441,14 @@ var PopupMenuBase = class {
         this.focusActor = sourceActor;
         this._parent = null;
 
-        if (styleClass !== undefined) {
-            this.box = new St.BoxLayout({ style_class: styleClass,
-                                          vertical: true });
-        } else {
-            this.box = new St.BoxLayout({ vertical: true });
-        }
+        this.box = new St.BoxLayout({
+            vertical: true,
+            x_expand: true,
+            y_expand: true,
+        });
+
+        if (styleClass !== undefined)
+            this.box.style_class = styleClass;
         this.length = 0;
 
         this.isOpen = false;
@@ -797,10 +798,7 @@ var PopupMenu = class extends PopupMenuBase {
         this._arrowAlignment = arrowAlignment;
         this._arrowSide = arrowSide;
 
-        this._boxPointer = new BoxPointer.BoxPointer(arrowSide,
-                                                     { x_fill: true,
-                                                       y_fill: true,
-                                                       x_align: St.Align.START });
+        this._boxPointer = new BoxPointer.BoxPointer(arrowSide);
         this.actor = this._boxPointer;
         this.actor._delegate = this;
         this.actor.style_class = 'popup-menu-boxpointer';
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 088fceb4c8..3712c198a4 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -98,8 +98,7 @@ var NotificationsBox = GObject.registerClass({
             style_class: 'screen-shield-notifications-container'
         });
 
-        this._scrollView = new St.ScrollView({ x_fill: false, x_align: St.Align.START,
-                                               hscrollbar_policy: St.PolicyType.NEVER });
+        this._scrollView = new St.ScrollView({ hscrollbar_policy: St.PolicyType.NEVER });
         this._notificationBox = new St.BoxLayout({ vertical: true,
                                                    style_class: 'screen-shield-notifications-container' });
         this._scrollView.add_actor(this._notificationBox);
@@ -165,9 +164,7 @@ var NotificationsBox = GObject.registerClass({
 
     _makeNotificationDetailedSource(source, box) {
         let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE);
-        let sourceBin = new St.Bin({ y_align: St.Align.START,
-                                     x_align: St.Align.START,
-                                     child: sourceActor });
+        let sourceBin = new St.Bin({ child: sourceActor });
         box.add(sourceBin);
 
         let textBox = new St.BoxLayout({ vertical: true });
@@ -355,9 +352,11 @@ var Arrow = GObject.registerClass(
 class ScreenShieldArrow extends St.Bin {
     _init(params) {
         super._init(params);
-        this.x_fill = this.y_fill = true;
 
-        this._drawingArea = new St.DrawingArea();
+        this._drawingArea = new St.DrawingArea({
+            x_expand: true,
+            y_expand: true,
+        });
         this._drawingArea.connect('repaint', this._drawArrow.bind(this));
         this.child = this._drawingArea;
 
diff --git a/js/ui/search.js b/js/ui/search.js
index 2b0af27cb1..3b4dbc25c8 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -43,8 +43,6 @@ class SearchResult extends St.Button {
             reactive: true,
             can_focus: true,
             track_hover: true,
-            x_align: St.Align.START,
-            y_fill: true
         });
     }
 
@@ -68,12 +66,13 @@ class ListSearchResult extends SearchResult {
         super._init(provider, metaInfo, resultsView);
 
         this.style_class = 'list-search-result';
-        this.x_fill = true;
 
         let content = new St.BoxLayout({
             style_class: 'list-search-result-content',
             vertical: false,
+            x_align: Clutter.ActorAlign.START,
             x_expand: true,
+            y_expand: true,
         });
         this.set_child(content);
 
@@ -142,7 +141,12 @@ class GridSearchResult extends SearchResult {
 
         this.icon = new IconGrid.BaseIcon(this.metaInfo['name'],
                                           { createIcon: this.metaInfo['createIcon'] });
-        let content = new St.Bin({ child: this.icon });
+        let content = new St.Bin({
+            child: this.icon,
+            x_align: Clutter.ActorAlign.START,
+            x_expand: true,
+            y_expand: true,
+        });
         this.set_child(content);
         this.label_actor = this.icon.label;
     }
@@ -166,7 +170,7 @@ var SearchResultsBase = GObject.registerClass({
         this._terms = [];
         this._focusChild = null;
 
-        this._resultDisplayBin = new St.Bin({ x_fill: true });
+        this._resultDisplayBin = new St.Bin();
         this.add_child(this._resultDisplayBin);
 
         let separator = new St.Widget({ style_class: 'search-section-separator' });
@@ -353,7 +357,7 @@ class GridSearchResults extends SearchResultsBase {
         this._grid = new IconGrid.IconGrid({ rowLimit: MAX_GRID_SEARCH_RESULTS_ROWS,
                                              xAlign: St.Align.START });
 
-        this._bin = new St.Bin({ x_align: St.Align.MIDDLE });
+        this._bin = new St.Bin({ x_align: Clutter.ActorAlign.CENTER });
         this._bin.set_child(this._grid);
 
         this._resultDisplayBin.set_child(this._bin);
@@ -427,8 +431,11 @@ var SearchResultsView = GObject.registerClass({
     _init() {
         super._init({ name: 'searchResults', vertical: true });
 
-        this._content = new MaxWidthBox({ name: 'searchResultsContent',
-                                          vertical: true });
+        this._content = new MaxWidthBox({
+            name: 'searchResultsContent',
+            vertical: true,
+            x_expand: true,
+        });
 
         this._scrollView = new St.ScrollView({
             overlay_scrollbars: true,
diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js
index a5dff2636f..968205a458 100644
--- a/js/ui/shellMountOperation.js
+++ b/js/ui/shellMountOperation.js
@@ -53,8 +53,6 @@ var ListItem = GObject.registerClass({
             can_focus: true,
             child: layout,
             reactive: true,
-            x_align: St.Align.START,
-            x_fill: true
         });
 
         this._app = app;
@@ -65,10 +63,12 @@ var ListItem = GObject.registerClass({
                                    child: this._icon });
         layout.add(iconBin);
 
-        this._nameLabel = new St.Label({ text: this._app.get_name(),
-                                         style_class: 'mount-dialog-app-list-item-name' });
-        let labelBin = new St.Bin({ y_align: St.Align.MIDDLE,
-                                    child: this._nameLabel });
+        this._nameLabel = new St.Label({
+            text: this._app.get_name(),
+            style_class: 'mount-dialog-app-list-item-name',
+            y_align: Clutter.ActorAlign.CENTER,
+        });
+        let labelBin = new St.Bin({ child: this._nameLabel });
         layout.add(labelBin);
     }
 
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index a584dce6df..077ab1fbe2 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -55,9 +55,7 @@ var UnlockDialog = GObject.registerClass({
             this._otherUserButton = new St.Button({ style_class: 'login-dialog-not-listed-button',
                                                     can_focus: true,
                                                     child: otherUserLabel,
-                                                    reactive: true,
-                                                    x_align: St.Align.START,
-                                                    x_fill: false });
+                                                    reactive: true });
             this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this));
             this._promptBox.add_child(this._otherUserButton);
         } else {
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 40396ab9c7..6b10ec600c 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -309,11 +309,8 @@ var ViewSelector = GObject.registerClass({
     _addPage(actor, name, a11yIcon, params) {
         params = Params.parse(params, { a11yFocus: null });
 
-        let page = new St.Bin({ child: actor,
-                                x_align: St.Align.START,
-                                y_align: St.Align.START,
-                                x_fill: true,
-                                y_fill: true });
+        let page = new St.Bin({ child: actor });
+
         if (params.a11yFocus)
             Main.ctrlAltTabManager.addGroup(params.a11yFocus, name, a11yIcon);
         else


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