cleanup: Use new indentation style for object literals

We have made good progress on object literals as well, although there
are still a lot that use the old style, given how ubiquitous object
literals are.

But the needed reindentation isn't overly intrusive, as changes are
limited to the object literals themselves (i.e. they don't affect
surrounding code).

And given that object literals account for quite a bit of the remaining
differences between regular and legacy rules, doing the transition now
is still worthwhile.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>
This commit is contained in:
Florian Müllner
2020-03-29 23:51:13 +02:00
committed by Marge Bot
parent ac9fbe92e5
commit 2b45a01517
70 changed files with 1357 additions and 852 deletions

View File

@ -394,13 +394,15 @@ var Notification = GObject.registerClass({
// the title/banner. If @params.clear is %true, it will also
// remove any additional actors/action buttons previously added.
update(title, banner, params) {
params = Params.parse(params, { gicon: null,
secondaryGIcon: null,
bannerMarkup: false,
clear: false,
datetime: null,
soundName: null,
soundFile: null });
params = Params.parse(params, {
gicon: null,
secondaryGIcon: null,
bannerMarkup: false,
clear: false,
datetime: null,
soundName: null,
soundFile: null,
});
this.title = title;
this.bannerBodyText = banner;
@ -561,16 +563,20 @@ var NotificationBanner = GObject.registerClass({
_addSecondaryIcon() {
if (this.notification.secondaryGIcon) {
let icon = new St.Icon({ gicon: this.notification.secondaryGIcon,
x_align: Clutter.ActorAlign.END });
const icon = new St.Icon({
gicon: this.notification.secondaryGIcon,
x_align: Clutter.ActorAlign.END,
});
this.setSecondaryActor(icon);
}
}
addButton(button, callback) {
if (!this._buttonBox) {
this._buttonBox = new St.BoxLayout({ style_class: 'notification-actions',
x_expand: true });
this._buttonBox = new St.BoxLayout({
style_class: 'notification-actions',
x_expand: true,
});
this.setActionArea(this._buttonBox);
global.focus_manager.add_group(this._buttonBox);
}
@ -596,10 +602,12 @@ var NotificationBanner = GObject.registerClass({
}
addAction(label, callback) {
let button = new St.Button({ style_class: 'notification-button',
label,
x_expand: true,
can_focus: true });
const button = new St.Button({
style_class: 'notification-button',
label,
x_expand: true,
can_focus: true,
});
return this.addButton(button, callback);
}
@ -620,9 +628,11 @@ 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_expand: true,
height: size * scaleFactor,
width: size * scaleFactor });
this._iconBin = new St.Bin({
x_expand: true,
height: size * scaleFactor,
width: size * scaleFactor,
});
this.add_actor(this._iconBin);
@ -732,8 +742,10 @@ var Source = GObject.registerClass({
// Provides a sane default implementation, override if you need
// something more fancy.
createIcon(size) {
return new St.Icon({ gicon: this.getIcon(),
icon_size: size });
return new St.Icon({
gicon: this.getIcon(),
icon_size: size,
});
}
getIcon() {
@ -836,14 +848,16 @@ var MessageTray = GObject.registerClass({
GObject.BindingFlags.SYNC_CREATE);
this.add_constraint(constraint);
this._bannerBin = new St.Widget({ name: 'notification-container',
reactive: true,
track_hover: true,
y_align: Clutter.ActorAlign.START,
x_align: Clutter.ActorAlign.CENTER,
y_expand: true,
x_expand: true,
layout_manager: new Clutter.BinLayout() });
this._bannerBin = new St.Widget({
name: 'notification-container',
reactive: true,
track_hover: true,
y_align: Clutter.ActorAlign.START,
x_align: Clutter.ActorAlign.CENTER,
y_expand: true,
x_expand: true,
layout_manager: new Clutter.BinLayout(),
});
this._bannerBin.connect('key-release-event',
this._onNotificationKeyRelease.bind(this));
this._bannerBin.connect('notify::hover',