js/status: Use menu items as actors

All menu items are actors now, so remove all the actor property usages.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/499
This commit is contained in:
Marco Trevisan (Treviño)
2019-04-12 16:00:49 -05:00
committed by Florian Müllner
parent bdf66d7b62
commit 41dd744b74
11 changed files with 59 additions and 58 deletions

View File

@ -116,10 +116,10 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this._createSubMenu();
this._loginScreenItem.actor.connect('notify::visible',
() => { this._updateMultiUser(); });
this._logoutItem.actor.connect('notify::visible',
() => { this._updateMultiUser(); });
this._loginScreenItem.connect('notify::visible',
() => { this._updateMultiUser(); });
this._logoutItem.connect('notify::visible',
() => { this._updateMultiUser(); });
// Whether shutdown is available or not depends on both lockdown
// settings (disable-log-out) and Polkit policy - the latter doesn't
// notify, so we update the menu item each time the menu opens or
@ -142,7 +142,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this._lockScreenAction.visible ||
this._altSwitcher.actor.visible);
this._actionsItem.actor.visible = visible;
this._actionsItem.visible = visible;
}
_sessionUpdated() {
@ -150,10 +150,10 @@ var Indicator = class extends PanelMenu.SystemIndicator {
}
_updateMultiUser() {
let hasSwitchUser = this._loginScreenItem.actor.visible;
let hasLogout = this._logoutItem.actor.visible;
let hasSwitchUser = this._loginScreenItem.visible;
let hasLogout = this._logoutItem.visible;
this._switchUserSubMenu.actor.visible = hasSwitchUser || hasLogout;
this._switchUserSubMenu.visible = hasSwitchUser || hasLogout;
}
_updateSwitchUserSubMenu() {
@ -208,7 +208,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this._switchUserSubMenu.menu.addMenuItem(item);
this._loginScreenItem = item;
this._systemActions.bind_property('can-switch-user',
this._loginScreenItem.actor,
this._loginScreenItem,
'visible',
bindFlags);
@ -220,7 +220,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this._switchUserSubMenu.menu.addMenuItem(item);
this._logoutItem = item;
this._systemActions.bind_property('can-logout',
this._logoutItem.actor,
this._logoutItem,
'visible',
bindFlags);
@ -236,7 +236,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
item = new PopupMenu.PopupBaseMenuItem({ reactive: false,
can_focus: false });
this.buttonGroup = item.actor;
this.buttonGroup = item;
let app = this._settingsApp = Shell.AppSystem.get_default().lookup_app(
'gnome-control-center.desktop'
@ -251,14 +251,14 @@ var Indicator = class extends PanelMenu.SystemIndicator {
log('Missing required core component Settings, expect trouble…');
this._settingsAction = new St.Widget();
}
item.actor.add(this._settingsAction, { expand: true, x_fill: false });
item.add(this._settingsAction, { expand: true, x_fill: false });
this._orientationLockAction = this._createActionButton('', _("Orientation Lock"));
this._orientationLockAction.connect('clicked', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE),
this._systemActions.activateLockOrientation();
});
item.actor.add(this._orientationLockAction, { expand: true, x_fill: false });
item.add(this._orientationLockAction, { expand: true, x_fill: false });
this._systemActions.bind_property('can-lock-orientation',
this._orientationLockAction,
'visible',
@ -273,7 +273,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateLockScreen();
});
item.actor.add(this._lockScreenAction, { expand: true, x_fill: false });
item.add(this._lockScreenAction, { expand: true, x_fill: false });
this._systemActions.bind_property('can-lock-screen',
this._lockScreenAction,
'visible',
@ -300,7 +300,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
bindFlags);
this._altSwitcher = new AltSwitcher(this._powerOffAction, this._suspendAction);
item.actor.add(this._altSwitcher.actor, { expand: true, x_fill: false });
item.add(this._altSwitcher.actor, { expand: true, x_fill: false });
this._actionsItem = item;
this.menu.addMenuItem(item);