cleanup: Remove spaces in object literals
We only adopted this style relatively recently, so there's a bit more to adjust. Still, it's manageable and another step towards getting rid of the legacy style. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
This commit is contained in:

committed by
Marge Bot

parent
6a22af83dc
commit
071f92cfb6
@ -127,7 +127,7 @@ class WorkspacesView extends WorkspacesViewBase {
|
||||
}
|
||||
|
||||
_getFirstFitAllWorkspaceBox(box, spacing, vertical) {
|
||||
const { nWorkspaces } = global.workspaceManager;
|
||||
const {nWorkspaces} = global.workspaceManager;
|
||||
const [width, height] = box.get_size();
|
||||
const [workspace] = this._workspaces;
|
||||
|
||||
@ -192,7 +192,7 @@ class WorkspacesView extends WorkspacesViewBase {
|
||||
x1 -= currentWorkspace * (workspaceWidth + spacing);
|
||||
}
|
||||
|
||||
const fitSingleBox = new Clutter.ActorBox({ x1, y1 });
|
||||
const fitSingleBox = new Clutter.ActorBox({x1, y1});
|
||||
|
||||
if (vertical) {
|
||||
const [, workspaceHeight] = workspace.get_preferred_height(width);
|
||||
@ -220,14 +220,14 @@ class WorkspacesView extends WorkspacesViewBase {
|
||||
}
|
||||
|
||||
const spacing = (availableSpace - workspaceSize * 0.4) * (1 - fitMode);
|
||||
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
|
||||
const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
|
||||
|
||||
return Math.clamp(spacing, WORKSPACE_MIN_SPACING * scaleFactor,
|
||||
WORKSPACE_MAX_SPACING * scaleFactor);
|
||||
}
|
||||
|
||||
_getWorkspaceModeForOverviewState(state) {
|
||||
const { ControlsState } = OverviewControls;
|
||||
const {ControlsState} = OverviewControls;
|
||||
|
||||
switch (state) {
|
||||
case ControlsState.HIDDEN:
|
||||
@ -245,7 +245,7 @@ class WorkspacesView extends WorkspacesViewBase {
|
||||
const adj = this._scrollAdjustment;
|
||||
const fitMode = this._fitModeAdjustment.value;
|
||||
|
||||
const { initialState, finalState, progress } =
|
||||
const {initialState, finalState, progress} =
|
||||
this._overviewAdjustment.getStateTransitionParams();
|
||||
|
||||
const workspaceMode = (1 - fitMode) * Util.lerp(
|
||||
@ -267,7 +267,7 @@ class WorkspacesView extends WorkspacesViewBase {
|
||||
}
|
||||
|
||||
_getFitModeForState(state) {
|
||||
const { ControlsState } = OverviewControls;
|
||||
const {ControlsState} = OverviewControls;
|
||||
|
||||
switch (state) {
|
||||
case ControlsState.HIDDEN:
|
||||
@ -287,7 +287,7 @@ class WorkspacesView extends WorkspacesViewBase {
|
||||
let fitSingleBox = offsetBox;
|
||||
let fitAllBox = offsetBox;
|
||||
|
||||
const { transitioning, initialState, finalState } =
|
||||
const {transitioning, initialState, finalState} =
|
||||
this._overviewAdjustment.getStateTransitionParams();
|
||||
|
||||
const isPrimary = Main.layoutManager.primaryIndex === this._monitorIndex;
|
||||
@ -405,7 +405,7 @@ class WorkspacesView extends WorkspacesViewBase {
|
||||
}
|
||||
|
||||
_scrollToActive() {
|
||||
const { workspaceManager } = global;
|
||||
const {workspaceManager} = global;
|
||||
const active = workspaceManager.get_active_workspace_index();
|
||||
|
||||
this._animating = true;
|
||||
@ -612,14 +612,14 @@ class SecondaryMonitorDisplay extends St.Widget {
|
||||
this.queue_relayout();
|
||||
}, this);
|
||||
|
||||
this._settings = new Gio.Settings({ schema_id: MUTTER_SCHEMA });
|
||||
this._settings = new Gio.Settings({schema_id: MUTTER_SCHEMA});
|
||||
this._settings.connect('changed::workspaces-only-on-primary',
|
||||
() => this._workspacesOnPrimaryChanged());
|
||||
this._workspacesOnPrimaryChanged();
|
||||
}
|
||||
|
||||
_getThumbnailParamsForState(state) {
|
||||
const { ControlsState } = OverviewControls;
|
||||
const {ControlsState} = OverviewControls;
|
||||
|
||||
let opacity, scale;
|
||||
switch (state) {
|
||||
@ -638,7 +638,7 @@ class SecondaryMonitorDisplay extends St.Widget {
|
||||
break;
|
||||
}
|
||||
|
||||
return { opacity, scale };
|
||||
return {opacity, scale};
|
||||
}
|
||||
|
||||
_getThumbnailsHeight(box) {
|
||||
@ -646,7 +646,7 @@ class SecondaryMonitorDisplay extends St.Widget {
|
||||
return 0;
|
||||
|
||||
const [width, height] = box.get_size();
|
||||
const { expandFraction } = this._thumbnails;
|
||||
const {expandFraction} = this._thumbnails;
|
||||
const [thumbnailsHeight] = this._thumbnails.get_preferred_height(width);
|
||||
return Math.min(
|
||||
thumbnailsHeight * expandFraction,
|
||||
@ -654,7 +654,7 @@ class SecondaryMonitorDisplay extends St.Widget {
|
||||
}
|
||||
|
||||
_getWorkspacesBoxForState(state, box, padding, thumbnailsHeight, spacing) {
|
||||
const { ControlsState } = OverviewControls;
|
||||
const {ControlsState} = OverviewControls;
|
||||
const workspaceBox = box.copy();
|
||||
const [width, height] = workspaceBox.get_size();
|
||||
|
||||
@ -684,7 +684,7 @@ class SecondaryMonitorDisplay extends St.Widget {
|
||||
const themeNode = this.get_theme_node();
|
||||
const contentBox = themeNode.get_content_box(box);
|
||||
const [width, height] = contentBox.get_size();
|
||||
const { expandFraction } = this._thumbnails;
|
||||
const {expandFraction} = this._thumbnails;
|
||||
const spacing = themeNode.get_length('spacing') * expandFraction;
|
||||
const padding =
|
||||
Math.round((1 - SECONDARY_WORKSPACE_SCALE) * height / 2);
|
||||
@ -768,7 +768,7 @@ class SecondaryMonitorDisplay extends St.Widget {
|
||||
if (!this._thumbnails.visible)
|
||||
return;
|
||||
|
||||
const { initialState, finalState, progress } =
|
||||
const {initialState, finalState, progress} =
|
||||
this._overviewAdjustment.getStateTransitionParams();
|
||||
|
||||
const initialParams = this._getThumbnailParamsForState(initialState);
|
||||
@ -834,7 +834,7 @@ class WorkspacesDisplay extends St.Widget {
|
||||
Main.layoutManager.overviewGroup,
|
||||
Clutter.Orientation.HORIZONTAL,
|
||||
Shell.ActionMode.OVERVIEW,
|
||||
{ allowDrag: false });
|
||||
{allowDrag: false});
|
||||
this._swipeTracker.allowLongSwipes = true;
|
||||
this._swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
|
||||
this._swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));
|
||||
@ -854,7 +854,7 @@ class WorkspacesDisplay extends St.Widget {
|
||||
this._primaryIndex = Main.layoutManager.primaryIndex;
|
||||
this._workspacesViews = [];
|
||||
|
||||
this._settings = new Gio.Settings({ schema_id: MUTTER_SCHEMA });
|
||||
this._settings = new Gio.Settings({schema_id: MUTTER_SCHEMA});
|
||||
|
||||
this._inWindowDrag = false;
|
||||
this._leavingOverview = false;
|
||||
@ -897,7 +897,7 @@ class WorkspacesDisplay extends St.Widget {
|
||||
}
|
||||
|
||||
_updateTrackerOrientation() {
|
||||
const { layoutRows } = global.workspace_manager;
|
||||
const {layoutRows} = global.workspace_manager;
|
||||
this._swipeTracker.orientation = layoutRows !== -1
|
||||
? Clutter.Orientation.HORIZONTAL
|
||||
: Clutter.Orientation.VERTICAL;
|
||||
@ -936,7 +936,7 @@ class WorkspacesDisplay extends St.Widget {
|
||||
|
||||
let progress = adjustment.value / adjustment.page_size;
|
||||
let points = Array.from(
|
||||
{ length: workspaceManager.n_workspaces }, (v, i) => i);
|
||||
{length: workspaceManager.n_workspaces}, (v, i) => i);
|
||||
|
||||
tracker.confirmSwipe(distance, points, progress, Math.round(progress));
|
||||
|
||||
@ -1052,7 +1052,7 @@ class WorkspacesDisplay extends St.Widget {
|
||||
|
||||
_getMonitorIndexForEvent(event) {
|
||||
let [x, y] = event.get_coords();
|
||||
let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 });
|
||||
let rect = new Meta.Rectangle({x, y, width: 1, height: 1});
|
||||
return global.display.get_monitor_index_for_rect(rect);
|
||||
}
|
||||
|
||||
@ -1089,14 +1089,14 @@ class WorkspacesDisplay extends St.Widget {
|
||||
}
|
||||
|
||||
_onKeyPressEvent(actor, event) {
|
||||
const { ControlsState } = OverviewControls;
|
||||
const {ControlsState} = OverviewControls;
|
||||
if (this._overviewAdjustment.value !== ControlsState.WINDOW_PICKER)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
if (!this.reactive)
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
|
||||
const { workspaceManager } = global;
|
||||
const {workspaceManager} = global;
|
||||
const vertical = workspaceManager.layout_rows === -1;
|
||||
const rtl = this.get_text_direction() === Clutter.TextDirection.RTL;
|
||||
|
||||
|
Reference in New Issue
Block a user