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:

committed by
Marge Bot

parent
ac9fbe92e5
commit
2b45a01517
@ -1,8 +1,7 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
/* exported Dash */
|
||||
|
||||
const { Clutter, GLib, GObject,
|
||||
Graphene, Meta, Shell, St } = imports.gi;
|
||||
const { Clutter, GLib, GObject, Graphene, Meta, Shell, St } = imports.gi;
|
||||
|
||||
const AppDisplay = imports.ui.appDisplay;
|
||||
const AppFavorites = imports.ui.appFavorites;
|
||||
@ -196,15 +195,18 @@ class ShowAppsIcon extends DashItemContainer {
|
||||
_init() {
|
||||
super._init();
|
||||
|
||||
this.toggleButton = new St.Button({ style_class: 'show-apps',
|
||||
track_hover: true,
|
||||
can_focus: true,
|
||||
toggle_mode: true });
|
||||
this.toggleButton = new St.Button({
|
||||
style_class: 'show-apps',
|
||||
track_hover: true,
|
||||
can_focus: true,
|
||||
toggle_mode: true,
|
||||
});
|
||||
this._iconActor = null;
|
||||
this.icon = new IconGrid.BaseIcon(_("Show Applications"),
|
||||
{ setSizeManually: true,
|
||||
showLabel: false,
|
||||
createIcon: this._createIcon.bind(this) });
|
||||
this.icon = new IconGrid.BaseIcon(_('Show Applications'), {
|
||||
setSizeManually: true,
|
||||
showLabel: false,
|
||||
createIcon: this._createIcon.bind(this),
|
||||
});
|
||||
this.icon.y_align = Clutter.ActorAlign.CENTER;
|
||||
|
||||
this.toggleButton.add_actor(this.icon);
|
||||
@ -215,10 +217,12 @@ class ShowAppsIcon extends DashItemContainer {
|
||||
}
|
||||
|
||||
_createIcon(size) {
|
||||
this._iconActor = new St.Icon({ icon_name: 'view-app-grid-symbolic',
|
||||
icon_size: size,
|
||||
style_class: 'show-apps-icon',
|
||||
track_hover: true });
|
||||
this._iconActor = new St.Icon({
|
||||
icon_name: 'view-app-grid-symbolic',
|
||||
icon_size: size,
|
||||
style_class: 'show-apps-icon',
|
||||
track_hover: true,
|
||||
});
|
||||
return this._iconActor;
|
||||
}
|
||||
|
||||
@ -738,9 +742,11 @@ var Dash = GObject.registerClass({
|
||||
|
||||
// App added at newIndex
|
||||
if (newApp && !oldApps.includes(newApp)) {
|
||||
addedItems.push({ app: newApp,
|
||||
item: this._createAppItem(newApp),
|
||||
pos: newIndex });
|
||||
addedItems.push({
|
||||
app: newApp,
|
||||
item: this._createAppItem(newApp),
|
||||
pos: newIndex,
|
||||
});
|
||||
newIndex++;
|
||||
continue;
|
||||
}
|
||||
@ -756,9 +762,11 @@ var Dash = GObject.registerClass({
|
||||
|
||||
if (insertHere || alreadyRemoved) {
|
||||
let newItem = this._createAppItem(newApp);
|
||||
addedItems.push({ app: newApp,
|
||||
item: newItem,
|
||||
pos: newIndex + removedActors.length });
|
||||
addedItems.push({
|
||||
app: newApp,
|
||||
item: newItem,
|
||||
pos: newIndex + removedActors.length,
|
||||
});
|
||||
newIndex++;
|
||||
} else {
|
||||
removedActors.push(children[oldIndex]);
|
||||
|
Reference in New Issue
Block a user