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

@ -229,9 +229,11 @@ var LayoutManager = GObject.registerClass({
global.stage.remove_actor(global.top_window_group);
this.uiGroup.add_actor(global.top_window_group);
this.overviewGroup = new St.Widget({ name: 'overviewGroup',
visible: false,
reactive: true });
this.overviewGroup = new St.Widget({
name: 'overviewGroup',
visible: false,
reactive: true,
});
this.addChrome(this.overviewGroup);
this.screenShieldGroup = new St.Widget({
@ -242,20 +244,28 @@ var LayoutManager = GObject.registerClass({
});
this.addChrome(this.screenShieldGroup);
this.panelBox = new St.BoxLayout({ name: 'panelBox',
vertical: true });
this.addChrome(this.panelBox, { affectsStruts: true,
trackFullscreen: true });
this.panelBox = new St.BoxLayout({
name: 'panelBox',
vertical: true,
});
this.addChrome(this.panelBox, {
affectsStruts: true,
trackFullscreen: true,
});
this.panelBox.connect('notify::allocation',
this._panelBoxChanged.bind(this));
this.modalDialogGroup = new St.Widget({ name: 'modalDialogGroup',
layout_manager: new Clutter.BinLayout() });
this.modalDialogGroup = new St.Widget({
name: 'modalDialogGroup',
layout_manager: new Clutter.BinLayout(),
});
this.uiGroup.add_actor(this.modalDialogGroup);
this.keyboardBox = new St.BoxLayout({ name: 'keyboardBox',
reactive: true,
track_hover: true });
this.keyboardBox = new St.BoxLayout({
name: 'keyboardBox',
reactive: true,
track_hover: true,
});
this.addTopChrome(this.keyboardBox);
this._keyboardHeightNotifyId = 0;
@ -448,9 +458,11 @@ var LayoutManager = GObject.registerClass({
}
_createBackgroundManager(monitorIndex) {
let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
layoutManager: this,
monitorIndex });
const bgManager = new Background.BackgroundManager({
container: this._backgroundGroup,
layoutManager: this,
monitorIndex,
});
bgManager.connect('changed', this._addBackgroundMenu.bind(this));
this._addBackgroundMenu(bgManager);
@ -543,10 +555,12 @@ var LayoutManager = GObject.registerClass({
if (this.panelBox.height) {
let primary = this.primaryMonitor;
this._rightPanelBarrier = new Meta.Barrier({ display: global.display,
x1: primary.x + primary.width, y1: primary.y,
x2: primary.x + primary.width, y2: primary.y + this.panelBox.height,
directions: Meta.BarrierDirection.NEGATIVE_X });
this._rightPanelBarrier = new Meta.Barrier({
display: global.display,
x1: primary.x + primary.width, y1: primary.y,
x2: primary.x + primary.width, y2: primary.y + this.panelBox.height,
directions: Meta.BarrierDirection.NEGATIVE_X,
});
}
}
@ -620,8 +634,10 @@ var LayoutManager = GObject.registerClass({
global.stage.insert_child_below(this._systemBackground, null);
let constraint = new Clutter.BindConstraint({ source: global.stage,
coordinate: Clutter.BindCoordinate.ALL });
const constraint = new Clutter.BindConstraint({
source: global.stage,
coordinate: Clutter.BindCoordinate.ALL,
});
this._systemBackground.add_constraint(constraint);
let signalId = this._systemBackground.connect('loaded', () => {
@ -661,10 +677,12 @@ var LayoutManager = GObject.registerClass({
async _prepareStartupAnimation() {
// During the initial transition, add a simple actor to block all events,
// so they don't get delivered to X11 windows that have been transformed.
this._coverPane = new Clutter.Actor({ opacity: 0,
width: global.screen_width,
height: global.screen_height,
reactive: true });
this._coverPane = new Clutter.Actor({
opacity: 0,
width: global.screen_width,
height: global.screen_height,
reactive: true,
});
this.addChrome(this._coverPane);
if (Meta.is_restart()) {
@ -1133,19 +1151,27 @@ class HotCorner extends Clutter.Actor {
if (size > 0) {
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
this._verticalBarrier = new Meta.Barrier({ display: global.display,
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
directions: Meta.BarrierDirection.NEGATIVE_X });
this._horizontalBarrier = new Meta.Barrier({ display: global.display,
x1: this._x - size, x2: this._x, y1: this._y, y2: this._y,
directions: Meta.BarrierDirection.POSITIVE_Y });
this._verticalBarrier = new Meta.Barrier({
display: global.display,
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
directions: Meta.BarrierDirection.NEGATIVE_X,
});
this._horizontalBarrier = new Meta.Barrier({
display: global.display,
x1: this._x - size, x2: this._x, y1: this._y, y2: this._y,
directions: Meta.BarrierDirection.POSITIVE_Y,
});
} else {
this._verticalBarrier = new Meta.Barrier({ display: global.display,
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
directions: Meta.BarrierDirection.POSITIVE_X });
this._horizontalBarrier = new Meta.Barrier({ display: global.display,
x1: this._x, x2: this._x + size, y1: this._y, y2: this._y,
directions: Meta.BarrierDirection.POSITIVE_Y });
this._verticalBarrier = new Meta.Barrier({
display: global.display,
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
directions: Meta.BarrierDirection.POSITIVE_X,
});
this._horizontalBarrier = new Meta.Barrier({
display: global.display,
x1: this._x, x2: this._x + size, y1: this._y, y2: this._y,
directions: Meta.BarrierDirection.POSITIVE_Y,
});
}
this._pressureBarrier.addBarrier(this._verticalBarrier);
@ -1164,11 +1190,13 @@ class HotCorner extends Clutter.Actor {
reactive: true,
});
this._corner = new Clutter.Actor({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: true });
this._corner = new Clutter.Actor({
name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: true,
});
this._corner._delegate = this;
this.add_child(this._corner);