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
This commit is contained in:
Florian Müllner 2019-10-17 23:40:24 +02:00
parent 72af64d964
commit f2bd39b20c
25 changed files with 155 additions and 140 deletions

View File

@ -88,8 +88,6 @@ var AuthPrompt = GObject.registerClass({
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));
this._userWell = new St.Bin({ this._userWell = new St.Bin({
x_fill: true,
x_align: St.Align.START,
x_expand: true, x_expand: true,
y_expand: true, y_expand: true,
}); });
@ -447,6 +445,7 @@ var AuthPrompt = GObject.registerClass({
if (user) { if (user) {
let userWidget = new UserWidget.UserWidget(user); let userWidget = new UserWidget.UserWidget(user);
userWidget.x_align = Clutter.ActorAlign.START;
this._userWell.set_child(userWidget); this._userWell.set_child(userWidget);
} }
} }

View File

@ -42,7 +42,10 @@ var UserListItem = GObject.registerClass({
Signals: { 'activate': {} } Signals: { 'activate': {} }
}, class UserListItem extends St.Button { }, class UserListItem extends St.Button {
_init(user) { _init(user) {
let layout = new St.BoxLayout({ vertical: true }); let layout = new St.BoxLayout({
vertical: true,
x_align: Clutter.ActorAlign.START,
});
super._init({ super._init({
style_class: 'login-dialog-user-list-item', style_class: 'login-dialog-user-list-item',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
@ -50,8 +53,6 @@ var UserListItem = GObject.registerClass({
x_expand: true, x_expand: true,
child: layout, child: layout,
reactive: true, reactive: true,
x_align: St.Align.START,
x_fill: true
}); });
this.user = user; this.user = user;
@ -456,15 +457,18 @@ var LoginDialog = GObject.registerClass({
// translators: this message is shown below the user list on the // translators: this message is shown below the user list on the
// login screen. It can be activated to reveal an entry for // login screen. It can be activated to reveal an entry for
// manually entering the username. // manually entering the username.
let notListedLabel = new St.Label({ text: _("Not listed?"), let notListedLabel = new St.Label({
style_class: 'login-dialog-not-listed-label' }); text: _("Not listed?"),
this._notListedButton = new St.Button({ style_class: 'login-dialog-not-listed-button', style_class: 'login-dialog-not-listed-label',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, x_align: Clutter.ActorAlign.START,
can_focus: true, });
child: notListedLabel, this._notListedButton = new St.Button({
reactive: true, style_class: 'login-dialog-not-listed-button',
x_align: St.Align.START, button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
x_fill: true }); can_focus: true,
child: notListedLabel,
reactive: true,
});
this._notListedButton.connect('clicked', this._hideUserListAskForUsernameAndBeginVerification.bind(this)); this._notListedButton.connect('clicked', this._hideUserListAskForUsernameAndBeginVerification.bind(this));

View File

@ -655,7 +655,7 @@ class AppIcon extends St.BoxLayout {
this.app = app; this.app = app;
this.icon = null; 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.add_child(this._iconBin);
this.label = new St.Label({ this.label = new St.Label({
@ -894,12 +894,13 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
let title = windows[i].get_title(); let title = windows[i].get_title();
if (title) { if (title) {
let name = new St.Label({ text: title }); let name = new St.Label({
// St.Label doesn't support text-align so use a Bin text: title,
let bin = new St.Bin({ x_align: St.Align.MIDDLE }); // St.Label doesn't support text-align
x_align: Clutter.ActorAlign.CENTER,
});
this._labels.push(bin); this._labels.push(bin);
bin.add_actor(name); box.add_actor(name);
box.add_actor(bin);
this.addItem(box, name); this.addItem(box, name);
} else { } else {

View File

@ -305,10 +305,7 @@ var AllView = GObject.registerClass({
this._scrollView = new St.ScrollView({ style_class: 'all-apps', this._scrollView = new St.ScrollView({ style_class: 'all-apps',
x_expand: true, x_expand: true,
y_expand: true, y_expand: true,
x_fill: true, reactive: true, });
y_fill: false,
reactive: true,
y_align: St.Align.START });
this.add_actor(this._scrollView); this.add_actor(this._scrollView);
this._grid._delegate = this; this._grid._delegate = this;
@ -327,7 +324,10 @@ var AllView = GObject.registerClass({
this.folderIcons = []; this.folderIcons = [];
this._stack = new St.Widget({ layout_manager: new Clutter.BinLayout() }); 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._grid.currentPage = 0;
this._stack.add_actor(this._grid); 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._viewStackLayout.connect('allocated-size-changed', this._onAllocatedSizeChanged.bind(this));
this.add_actor(this._viewStack); this.add_actor(this._viewStack);
let layout = new ControlsBoxLayout({ homogeneous: true }); let layout = new ControlsBoxLayout({ homogeneous: true });
this._controls = new St.Widget({ style_class: 'app-view-controls', this._controls = new St.Widget({
layout_manager: layout }); style_class: 'app-view-controls',
layout_manager: layout,
x_align: Clutter.ActorAlign.CENTER,
});
this._controls.connect('notify::mapped', () => { this._controls.connect('notify::mapped', () => {
// controls are faded either with their parent or // controls are faded either with their parent or
// explicitly in animate(); we can't know how they'll be // explicitly in animate(); we can't know how they'll be
@ -1266,15 +1269,18 @@ class FolderView extends BaseAppView {
this._scrollView = new St.ScrollView({ this._scrollView = new St.ScrollView({
overlay_scrollbars: true, overlay_scrollbars: true,
x_fill: true,
y_fill: true,
x_expand: true, x_expand: true,
y_expand: true y_expand: true
}); });
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
this.add_actor(this._scrollView); 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); scrollableContainer.add_actor(this._grid);
this._scrollView.add_actor(scrollableContainer); this._scrollView.add_actor(scrollableContainer);
@ -1462,8 +1468,6 @@ var FolderIcon = GObject.registerClass({
button_mask: St.ButtonMask.ONE, button_mask: St.ButtonMask.ONE,
toggle_mode: true, toggle_mode: true,
can_focus: true, can_focus: true,
x_fill: true,
y_fill: true
}); });
this.id = id; this.id = id;
this.name = ''; this.name = '';
@ -1902,10 +1906,7 @@ var AppFolderPopup = GObject.registerClass({
this._boxPointer = new BoxPointer.BoxPointer(this._arrowSide, this._boxPointer = new BoxPointer.BoxPointer(this._arrowSide,
{ style_class: 'app-folder-popup-bin', { style_class: 'app-folder-popup-bin',
x_fill: true, x_expand: true, });
y_fill: true,
x_expand: true,
x_align: St.Align.START });
this._boxPointer.style_class = 'app-folder-popup'; this._boxPointer.style_class = 'app-folder-popup';
this.add_actor(this._boxPointer); this.add_actor(this._boxPointer);
@ -2057,8 +2058,6 @@ var AppIcon = GObject.registerClass({
reactive: true, reactive: true,
button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO, button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO,
can_focus: true, can_focus: true,
x_fill: true,
y_fill: true
}); });
this.app = app; this.app = app;

View File

@ -790,8 +790,8 @@ class EventsSection extends MessageList.MessageListSection {
this._title = new St.Button({ style_class: 'events-section-title', this._title = new St.Button({ style_class: 'events-section-title',
label: '', label: '',
x_align: St.Align.START,
can_focus: true }); can_focus: true });
this._title.child.x_align = Clutter.ActorAlign.START;
this.insert_child_below(this._title, null); this.insert_child_below(this._title, null);
this._title.connect('clicked', this._onTitleClicked.bind(this)); 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', this._scrollView = new St.ScrollView({ style_class: 'vfade',
overlay_scrollbars: true, overlay_scrollbars: true,
x_expand: true, y_expand: true, x_expand: true, y_expand: true, });
x_fill: true, y_fill: true });
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
box.add_actor(this._scrollView); box.add_actor(this._scrollView);
@ -1098,6 +1097,7 @@ class CalendarMessageList extends St.Widget {
this._sectionList = new St.BoxLayout({ style_class: 'message-list-sections', this._sectionList = new St.BoxLayout({ style_class: 'message-list-sections',
vertical: true, vertical: true,
x_expand: true,
y_expand: true, y_expand: true,
y_align: Clutter.ActorAlign.START }); y_align: Clutter.ActorAlign.START });
this._sectionList.connect('actor-added', this._sync.bind(this)); this._sectionList.connect('actor-added', this._sync.bind(this));

View File

@ -11,11 +11,12 @@ class CheckBox extends St.Button {
button_mask: St.ButtonMask.ONE, button_mask: St.ButtonMask.ONE,
toggle_mode: true, toggle_mode: true,
can_focus: 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); this._box.set_y_align(Clutter.ActorAlign.START);
container.add_actor(this._box); container.add_actor(this._box);

View File

@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Component */ /* exported Component */
const { Gio, GObject, St } = imports.gi; const { Clutter, Gio, GObject, St } = imports.gi;
const GnomeSession = imports.misc.gnomeSession; const GnomeSession = imports.misc.gnomeSession;
const Main = imports.ui.main; const Main = imports.ui.main;
@ -320,20 +320,23 @@ class AutorunNotification extends MessageTray.Notification {
} }
_buttonForApp(app) { _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(), let icon = new St.Icon({ gicon: app.get_icon(),
style_class: 'hotplug-notification-item-icon' }); style_class: 'hotplug-notification-item-icon' });
box.add(icon); box.add(icon);
let label = new St.Bin({ let label = new St.Bin({
y_align: St.Align.MIDDLE, child: new St.Label({
child: new St.Label({ text: _("Open with %s").format(app.get_name()) }), text: _("Open with %s").format(app.get_name()),
y_align: Clutter.ActorAlign.CENTER,
}),
}); });
box.add(label); box.add(label);
let button = new St.Button({ child: box, let button = new St.Button({ child: box,
x_fill: true,
x_align: St.Align.START,
x_expand: true, x_expand: true,
button_mask: St.ButtonMask.ONE, button_mask: St.ButtonMask.ONE,
style_class: 'hotplug-notification-item button' }); style_class: 'hotplug-notification-item button' });

View File

@ -285,9 +285,12 @@ var DashActor = GObject.registerClass(
class DashActor extends St.Widget { class DashActor extends St.Widget {
_init() { _init() {
let layout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.VERTICAL }); let layout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.VERTICAL });
super._init({ name: 'dash', super._init({
layout_manager: layout, name: 'dash',
clip_to_allocation: true }); layout_manager: layout,
clip_to_allocation: true,
y_align: Clutter.ActorAlign.CENTER,
});
} }
vfunc_allocate(box, flags) { vfunc_allocate(box, flags) {

View File

@ -37,7 +37,6 @@ class TodayButton extends St.Button {
// until the selected date changes. // until the selected date changes.
super._init({ super._init({
style_class: 'datemenu-today-button', style_class: 'datemenu-today-button',
x_align: St.Align.START,
x_expand: true, x_expand: true,
can_focus: true, can_focus: true,
reactive: false reactive: false
@ -90,7 +89,6 @@ class WorldClocksSection extends St.Button {
_init() { _init() {
super._init({ super._init({
style_class: 'world-clocks-button', style_class: 'world-clocks-button',
x_fill: true,
can_focus: true, can_focus: true,
x_expand: true, x_expand: true,
}); });
@ -101,6 +99,7 @@ class WorldClocksSection extends St.Button {
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL }); let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
this._grid = new St.Widget({ style_class: 'world-clocks-grid', this._grid = new St.Widget({ style_class: 'world-clocks-grid',
x_expand: true,
layout_manager: layout }); layout_manager: layout });
layout.hookup_style(this._grid); layout.hookup_style(this._grid);
@ -253,15 +252,17 @@ class WeatherSection extends St.Button {
_init() { _init() {
super._init({ super._init({
style_class: 'weather-button', style_class: 'weather-button',
x_fill: true,
can_focus: true, can_focus: true,
x_expand: true, x_expand: true,
}); });
this._weatherClient = new Weather.WeatherClient(); this._weatherClient = new Weather.WeatherClient();
let box = new St.BoxLayout({ style_class: 'weather-box', let box = new St.BoxLayout({
vertical: true }); style_class: 'weather-box',
vertical: true,
x_expand: true,
});
this.child = box; this.child = box;
@ -582,12 +583,13 @@ class DateMenuButton extends PanelMenu.Button {
vbox.add_actor(this._calendar); vbox.add_actor(this._calendar);
this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade', this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade',
x_expand: true, x_fill: true, x_expand: true,
overlay_scrollbars: true }); overlay_scrollbars: true });
this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
vbox.add_actor(this._displaysSection); vbox.add_actor(this._displaysSection);
let displaysBox = new St.BoxLayout({ vertical: true, let displaysBox = new St.BoxLayout({ vertical: true,
x_expand: true,
style_class: 'datemenu-displays-box' }); style_class: 'datemenu-displays-box' });
this._displaysSection.add_actor(displaysBox); this._displaysSection.add_actor(displaysBox);

View File

@ -39,18 +39,19 @@ class BaseIcon extends St.Bin {
if (params.showLabel) if (params.showLabel)
styleClass += ' overview-icon-with-label'; styleClass += ' overview-icon-with-label';
super._init({ style_class: styleClass, super._init({ style_class: styleClass });
x_fill: true,
y_fill: true });
this.connect('destroy', this._onDestroy.bind(this)); 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.set_child(this._box);
this.iconSize = ICON_SIZE; this.iconSize = ICON_SIZE;
this._iconBin = new St.Bin({ x_align: St.Align.MIDDLE, this._iconBin = new St.Bin();
y_align: St.Align.MIDDLE });
this._box.add_actor(this._iconBin); this._box.add_actor(this._iconBin);

View File

@ -292,10 +292,7 @@ var Key = GObject.registerClass({
if (this._extended_keys.length == 0) if (this._extended_keys.length == 0)
return; return;
this._boxPointer = new BoxPointer.BoxPointer(St.Side.BOTTOM, this._boxPointer = new BoxPointer.BoxPointer(St.Side.BOTTOM);
{ x_fill: true,
y_fill: true,
x_align: St.Align.START });
this._boxPointer.hide(); this._boxPointer.hide();
Main.layoutManager.addTopChrome(this._boxPointer); Main.layoutManager.addTopChrome(this._boxPointer);
this._boxPointer.setPosition(this.keyButton, 0.5); this._boxPointer.setPosition(this.keyButton, 0.5);

View File

@ -264,7 +264,7 @@ class ObjLink extends St.Button {
reactive: true, reactive: true,
track_hover: true, track_hover: true,
style_class: 'shell-link', style_class: 'shell-link',
label: text label: text,
}); });
this.set_x_align(Clutter.ActorAlign.START); this.set_x_align(Clutter.ActorAlign.START);
this.get_child().single_line_mode = true; this.get_child().single_line_mode = true;
@ -359,8 +359,6 @@ class ObjInspector extends St.ScrollView {
_init(lookingGlass) { _init(lookingGlass) {
super._init({ super._init({
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
x_fill: true,
y_fill: true
}); });
this._obj = null; this._obj = null;
@ -369,9 +367,13 @@ class ObjInspector extends St.ScrollView {
this._parentList = []; this._parentList = [];
this.get_hscroll_bar().hide(); this.get_hscroll_bar().hide();
this._container = new St.BoxLayout({ name: 'LookingGlassPropertyInspector', this._container = new St.BoxLayout({
style_class: 'lg-dialog', name: 'LookingGlassPropertyInspector',
vertical: true }); style_class: 'lg-dialog',
vertical: true,
x_expand: true,
y_expand: true,
});
this.add_actor(this._container); this.add_actor(this._container);
this._lookingGlass = lookingGlass; this._lookingGlass = lookingGlass;

View File

@ -1278,7 +1278,7 @@ var ZoomRegion = class ZoomRegion {
_createActors() { _createActors() {
// The root actor for the zoom region // 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); global.stage.add_actor(this._magView);
// hide the magnified region from CLUTTER_PICK_ALL // hide the magnified region from CLUTTER_PICK_ALL

View File

@ -307,13 +307,16 @@ var Message = GObject.registerClass({
accessible_role: Atk.Role.NOTIFICATION, accessible_role: Atk.Role.NOTIFICATION,
can_focus: true, can_focus: true,
x_expand: true, x_expand: true,
x_fill: true y_expand: true,
}); });
this.expanded = false; this.expanded = false;
this._useBodyMarkup = 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); this.set_child(vbox);
let hbox = new St.BoxLayout(); let hbox = new St.BoxLayout();
@ -325,7 +328,7 @@ var Message = GObject.registerClass({
this._iconBin = new St.Bin({ style_class: 'message-icon-bin', this._iconBin = new St.Bin({ style_class: 'message-icon-bin',
y_expand: true, y_expand: true,
y_align: St.Align.START, y_align: Clutter.ActorAlign.START,
visible: false }); visible: false });
hbox.add_actor(this._iconBin); hbox.add_actor(this._iconBin);
@ -344,8 +347,7 @@ var Message = GObject.registerClass({
titleBox.add_actor(this.titleLabel); titleBox.add_actor(this.titleLabel);
this._secondaryBin = new St.Bin({ style_class: 'message-secondary-bin', this._secondaryBin = new St.Bin({ style_class: 'message-secondary-bin',
x_expand: true, y_expand: true, x_expand: true, y_expand: true, });
x_fill: true, y_fill: true });
titleBox.add_actor(this._secondaryBin); titleBox.add_actor(this._secondaryBin);
let closeIcon = new St.Icon({ icon_name: 'window-close-symbolic', let closeIcon = new St.Icon({ icon_name: 'window-close-symbolic',
@ -605,8 +607,6 @@ var MessageListSection = GObject.registerClass({
let listItem = new St.Bin({ let listItem = new St.Bin({
child: message, child: message,
x_fill: true,
y_fill: true,
layout_manager: new ScaleLayout(), layout_manager: new ScaleLayout(),
pivot_point: new Graphene.Point({ x: .5, y: .5 }), pivot_point: new Graphene.Point({ x: .5, y: .5 }),
}); });

View File

@ -632,8 +632,7 @@ class SourceActor extends St.Widget {
this._actorDestroyed = false; this._actorDestroyed = false;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._iconBin = new St.Bin({ x_fill: true, this._iconBin = new St.Bin({ x_expand: true,
x_expand: true,
height: size * scaleFactor, height: size * scaleFactor,
width: size * scaleFactor }); width: size * scaleFactor });

View File

@ -57,9 +57,12 @@ var ModalDialog = GObject.registerClass({
coordinate: Clutter.BindCoordinate.ALL }); coordinate: Clutter.BindCoordinate.ALL });
this.add_constraint(constraint); this.add_constraint(constraint);
this.backgroundStack = new St.Widget({ layout_manager: new Clutter.BinLayout() }); this.backgroundStack = new St.Widget({
this._backgroundBin = new St.Bin({ child: this.backgroundStack, layout_manager: new Clutter.BinLayout(),
x_fill: true, y_fill: true }); x_expand: true,
y_expand: true,
});
this._backgroundBin = new St.Bin({ child: this.backgroundStack });
this._monitorConstraint = new Layout.MonitorConstraint(); this._monitorConstraint = new Layout.MonitorConstraint();
this._backgroundBin.add_constraint(this._monitorConstraint); this._backgroundBin.add_constraint(this._monitorConstraint);
this.add_actor(this._backgroundBin); this.add_actor(this._backgroundBin);

View File

@ -111,7 +111,7 @@ class OverviewActor extends St.BoxLayout {
this._searchEntry.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); this._searchEntry.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
let searchEntryBin = new St.Bin({ let searchEntryBin = new St.Bin({
child: this._searchEntry, child: this._searchEntry,
x_align: St.Align.MIDDLE x_align: Clutter.ActorAlign.CENTER,
}); });
this.add_actor(searchEntryBin); this.add_actor(searchEntryBin);

View File

@ -29,17 +29,17 @@ var PadChooser = GObject.registerClass({
super._init({ super._init({
style_class: 'pad-chooser-button', style_class: 'pad-chooser-button',
toggle_mode: true, toggle_mode: true,
x_fill: false,
y_fill: false,
x_align: St.Align.MIDDLE,
y_align: St.Align.MIDDLE
}); });
this.currentDevice = device; this.currentDevice = device;
this._padChooserMenu = null; this._padChooserMenu = null;
let arrow = new St.Icon({ style_class: 'popup-menu-arrow', let arrow = new St.Icon({
icon_name: 'pan-down-symbolic', style_class: 'popup-menu-arrow',
accessible_role: Atk.Role.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.set_child(arrow);
this._ensureMenu(groupDevices); this._ensureMenu(groupDevices);

View File

@ -10,15 +10,17 @@ const PopupMenu = imports.ui.popupMenu;
var ButtonBox = GObject.registerClass( var ButtonBox = GObject.registerClass(
class ButtonBox extends St.Widget { class ButtonBox extends St.Widget {
_init(params) { _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); super._init(params);
this._delegate = this; this._delegate = this;
this.container = new St.Bin({ y_fill: true, this.container = new St.Bin({ child: this });
x_fill: true,
child: this });
this.connect('style-changed', this._onStyleChanged.bind(this)); this.connect('style-changed', this._onStyleChanged.bind(this));
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));

View File

@ -340,7 +340,6 @@ var PopupSwitchMenuItem = GObject.registerClass({
this.add_child(this.label); this.add_child(this.label);
this._statusBin = new St.Bin({ this._statusBin = new St.Bin({
x_align: St.Align.END,
x_expand: true, x_expand: true,
}); });
this._statusBin.set_x_align(Clutter.ActorAlign.END); this._statusBin.set_x_align(Clutter.ActorAlign.END);
@ -442,12 +441,14 @@ var PopupMenuBase = class {
this.focusActor = sourceActor; this.focusActor = sourceActor;
this._parent = null; this._parent = null;
if (styleClass !== undefined) { this.box = new St.BoxLayout({
this.box = new St.BoxLayout({ style_class: styleClass, vertical: true,
vertical: true }); x_expand: true,
} else { y_expand: true,
this.box = new St.BoxLayout({ vertical: true }); });
}
if (styleClass !== undefined)
this.box.style_class = styleClass;
this.length = 0; this.length = 0;
this.isOpen = false; this.isOpen = false;
@ -797,10 +798,7 @@ var PopupMenu = class extends PopupMenuBase {
this._arrowAlignment = arrowAlignment; this._arrowAlignment = arrowAlignment;
this._arrowSide = arrowSide; this._arrowSide = arrowSide;
this._boxPointer = new BoxPointer.BoxPointer(arrowSide, this._boxPointer = new BoxPointer.BoxPointer(arrowSide);
{ x_fill: true,
y_fill: true,
x_align: St.Align.START });
this.actor = this._boxPointer; this.actor = this._boxPointer;
this.actor._delegate = this; this.actor._delegate = this;
this.actor.style_class = 'popup-menu-boxpointer'; this.actor.style_class = 'popup-menu-boxpointer';

View File

@ -98,8 +98,7 @@ var NotificationsBox = GObject.registerClass({
style_class: 'screen-shield-notifications-container' style_class: 'screen-shield-notifications-container'
}); });
this._scrollView = new St.ScrollView({ x_fill: false, x_align: St.Align.START, this._scrollView = new St.ScrollView({ hscrollbar_policy: St.PolicyType.NEVER });
hscrollbar_policy: St.PolicyType.NEVER });
this._notificationBox = new St.BoxLayout({ vertical: true, this._notificationBox = new St.BoxLayout({ vertical: true,
style_class: 'screen-shield-notifications-container' }); style_class: 'screen-shield-notifications-container' });
this._scrollView.add_actor(this._notificationBox); this._scrollView.add_actor(this._notificationBox);
@ -165,9 +164,7 @@ var NotificationsBox = GObject.registerClass({
_makeNotificationDetailedSource(source, box) { _makeNotificationDetailedSource(source, box) {
let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE); let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE);
let sourceBin = new St.Bin({ y_align: St.Align.START, let sourceBin = new St.Bin({ child: sourceActor });
x_align: St.Align.START,
child: sourceActor });
box.add(sourceBin); box.add(sourceBin);
let textBox = new St.BoxLayout({ vertical: true }); let textBox = new St.BoxLayout({ vertical: true });
@ -355,9 +352,11 @@ var Arrow = GObject.registerClass(
class ScreenShieldArrow extends St.Bin { class ScreenShieldArrow extends St.Bin {
_init(params) { _init(params) {
super._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._drawingArea.connect('repaint', this._drawArrow.bind(this));
this.child = this._drawingArea; this.child = this._drawingArea;

View File

@ -43,8 +43,6 @@ class SearchResult extends St.Button {
reactive: true, reactive: true,
can_focus: true, can_focus: true,
track_hover: 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); super._init(provider, metaInfo, resultsView);
this.style_class = 'list-search-result'; this.style_class = 'list-search-result';
this.x_fill = true;
let content = new St.BoxLayout({ let content = new St.BoxLayout({
style_class: 'list-search-result-content', style_class: 'list-search-result-content',
vertical: false, vertical: false,
x_align: Clutter.ActorAlign.START,
x_expand: true, x_expand: true,
y_expand: true,
}); });
this.set_child(content); this.set_child(content);
@ -142,7 +141,12 @@ class GridSearchResult extends SearchResult {
this.icon = new IconGrid.BaseIcon(this.metaInfo['name'], this.icon = new IconGrid.BaseIcon(this.metaInfo['name'],
{ createIcon: this.metaInfo['createIcon'] }); { 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.set_child(content);
this.label_actor = this.icon.label; this.label_actor = this.icon.label;
} }
@ -166,7 +170,7 @@ var SearchResultsBase = GObject.registerClass({
this._terms = []; this._terms = [];
this._focusChild = null; this._focusChild = null;
this._resultDisplayBin = new St.Bin({ x_fill: true }); this._resultDisplayBin = new St.Bin();
this.add_child(this._resultDisplayBin); this.add_child(this._resultDisplayBin);
let separator = new St.Widget({ style_class: 'search-section-separator' }); 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, this._grid = new IconGrid.IconGrid({ rowLimit: MAX_GRID_SEARCH_RESULTS_ROWS,
xAlign: St.Align.START }); 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._bin.set_child(this._grid);
this._resultDisplayBin.set_child(this._bin); this._resultDisplayBin.set_child(this._bin);
@ -427,8 +431,11 @@ var SearchResultsView = GObject.registerClass({
_init() { _init() {
super._init({ name: 'searchResults', vertical: true }); super._init({ name: 'searchResults', vertical: true });
this._content = new MaxWidthBox({ name: 'searchResultsContent', this._content = new MaxWidthBox({
vertical: true }); name: 'searchResultsContent',
vertical: true,
x_expand: true,
});
this._scrollView = new St.ScrollView({ this._scrollView = new St.ScrollView({
overlay_scrollbars: true, overlay_scrollbars: true,

View File

@ -53,8 +53,6 @@ var ListItem = GObject.registerClass({
can_focus: true, can_focus: true,
child: layout, child: layout,
reactive: true, reactive: true,
x_align: St.Align.START,
x_fill: true
}); });
this._app = app; this._app = app;
@ -65,10 +63,12 @@ var ListItem = GObject.registerClass({
child: this._icon }); child: this._icon });
layout.add(iconBin); layout.add(iconBin);
this._nameLabel = new St.Label({ text: this._app.get_name(), this._nameLabel = new St.Label({
style_class: 'mount-dialog-app-list-item-name' }); text: this._app.get_name(),
let labelBin = new St.Bin({ y_align: St.Align.MIDDLE, style_class: 'mount-dialog-app-list-item-name',
child: this._nameLabel }); y_align: Clutter.ActorAlign.CENTER,
});
let labelBin = new St.Bin({ child: this._nameLabel });
layout.add(labelBin); layout.add(labelBin);
} }

View File

@ -55,9 +55,7 @@ var UnlockDialog = GObject.registerClass({
this._otherUserButton = new St.Button({ style_class: 'login-dialog-not-listed-button', this._otherUserButton = new St.Button({ style_class: 'login-dialog-not-listed-button',
can_focus: true, can_focus: true,
child: otherUserLabel, child: otherUserLabel,
reactive: true, reactive: true });
x_align: St.Align.START,
x_fill: false });
this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this)); this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this));
this._promptBox.add_child(this._otherUserButton); this._promptBox.add_child(this._otherUserButton);
} else { } else {

View File

@ -309,11 +309,8 @@ var ViewSelector = GObject.registerClass({
_addPage(actor, name, a11yIcon, params) { _addPage(actor, name, a11yIcon, params) {
params = Params.parse(params, { a11yFocus: null }); params = Params.parse(params, { a11yFocus: null });
let page = new St.Bin({ child: actor, let page = new St.Bin({ child: actor });
x_align: St.Align.START,
y_align: St.Align.START,
x_fill: true,
y_fill: true });
if (params.a11yFocus) if (params.a11yFocus)
Main.ctrlAltTabManager.addGroup(params.a11yFocus, name, a11yIcon); Main.ctrlAltTabManager.addGroup(params.a11yFocus, name, a11yIcon);
else else