From 2b45a01517aac3c3c429102e6f9f1acbba7d9387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 29 Mar 2020 23:51:13 +0200 Subject: [PATCH] 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: --- js/gdm/authPrompt.js | 6 +- js/gdm/loginDialog.js | 58 ++++++----- js/gdm/oVirt.js | 14 +-- js/gdm/util.js | 6 +- js/gdm/vmware.js | 14 +-- js/misc/history.js | 8 +- js/misc/objectManager.js | 42 ++++---- js/misc/smartcardManager.js | 12 ++- js/misc/util.js | 6 +- js/perf/core.js | 139 ++++++++++++++++----------- js/perf/hwtest.js | 55 ++++++----- js/portalHelper/main.js | 52 ++++++---- js/ui/accessDialog.js | 18 ++-- js/ui/altTab.js | 52 ++++++---- js/ui/appDisplay.js | 19 ++-- js/ui/audioDeviceSelection.js | 28 ++++-- js/ui/background.js | 8 +- js/ui/closeDialog.js | 16 +-- js/ui/components/automountManager.js | 16 +-- js/ui/components/autorunManager.js | 16 +-- js/ui/components/networkAgent.js | 8 +- js/ui/components/polkitAgent.js | 28 ++++-- js/ui/components/telepathyClient.js | 89 ++++++++++------- js/ui/ctrlAltTab.js | 47 +++++---- js/ui/dash.js | 48 +++++---- js/ui/dateMenu.js | 63 +++++++----- js/ui/endSessionDialog.js | 30 +++--- js/ui/environment.js | 6 +- js/ui/grabHelper.js | 14 ++- js/ui/ibusCandidatePopup.js | 26 +++-- js/ui/inhibitShortcutsDialog.js | 28 +++--- js/ui/kbdA11yDialog.js | 32 +++--- js/ui/keyboard.js | 41 +++++--- js/ui/layout.js | 112 +++++++++++++-------- js/ui/lookingGlass.js | 109 +++++++++++++-------- js/ui/magnifier.js | 63 +++++++----- js/ui/main.js | 27 ++++-- js/ui/messageList.js | 46 ++++++--- js/ui/messageTray.js | 70 ++++++++------ js/ui/modalDialog.js | 30 +++--- js/ui/notificationDaemon.js | 51 ++++++---- js/ui/osdMonitorLabeler.js | 12 ++- js/ui/overview.js | 13 ++- js/ui/padOsd.js | 82 ++++++++++------ js/ui/pageIndicators.js | 12 ++- js/ui/panel.js | 18 ++-- js/ui/popupMenu.js | 52 ++++++---- js/ui/remoteSearch.js | 28 +++--- js/ui/ripples.js | 36 ++++--- js/ui/screenShield.js | 32 +++--- js/ui/screenshot.js | 12 ++- js/ui/scripting.js | 12 ++- js/ui/search.js | 26 +++-- js/ui/shellDBus.js | 12 ++- js/ui/status/brightness.js | 6 +- js/ui/status/dwellClick.js | 6 +- js/ui/status/keyboard.js | 6 +- js/ui/status/location.js | 14 ++- js/ui/status/network.js | 80 +++++++++------ js/ui/switchMonitor.js | 12 ++- js/ui/switcherPopup.js | 50 ++++++---- js/ui/unlockDialog.js | 6 +- js/ui/userWidget.js | 12 ++- js/ui/welcomeDialog.js | 16 +-- js/ui/windowManager.js | 37 ++++--- js/ui/windowPreview.js | 16 +-- js/ui/workspace.js | 16 +-- js/ui/workspaceThumbnail.js | 21 ++-- js/ui/xdndHandler.js | 6 +- lint/eslintrc-legacy.yml | 5 - 70 files changed, 1357 insertions(+), 852 deletions(-) diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index 01ece6bd0..f9673468f 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -653,8 +653,10 @@ var AuthPrompt = GObject.registerClass({ } begin(params) { - params = Params.parse(params, { userName: null, - hold: null }); + params = Params.parse(params, { + userName: null, + hold: null, + }); this.updateSensitivity(false); diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index f114e86ea..3bde6fb06 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -17,8 +17,10 @@ * along with this program; if not, see . */ -const { AccountsService, Atk, Clutter, Gdm, Gio, - GLib, GObject, Meta, Pango, Shell, St } = imports.gi; +const { + AccountsService, Atk, Clutter, Gdm, Gio, + GLib, GObject, Meta, Pango, Shell, St, +} = imports.gi; const AuthPrompt = imports.gdm.authPrompt; const Batch = imports.gdm.batch; @@ -67,9 +69,11 @@ var UserListItem = GObject.registerClass({ this._userWidget.bind_property('label-actor', this, 'label-actor', GObject.BindingFlags.SYNC_CREATE); - this._timedLoginIndicator = new St.Bin({ style_class: 'login-dialog-timed-login-indicator', - scale_x: 0, - visible: false }); + this._timedLoginIndicator = new St.Bin({ + style_class: 'login-dialog-timed-login-indicator', + scale_x: 0, + visible: false, + }); layout.add(this._timedLoginIndicator); this._onUserChanged(); @@ -167,9 +171,11 @@ var UserList = GObject.registerClass({ this.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); - this._box = new St.BoxLayout({ vertical: true, - style_class: 'login-dialog-user-list', - pseudo_class: 'expanded' }); + this._box = new St.BoxLayout({ + vertical: true, + style_class: 'login-dialog-user-list', + pseudo_class: 'expanded', + }); this.add_actor(this._box); this._items = {}; @@ -438,11 +444,13 @@ var LoginDialog = GObject.registerClass({ this._updateLogoTextureId = this._textureCache.connect('texture-file-changed', this._updateLogoTexture.bind(this)); - this._userSelectionBox = new St.BoxLayout({ style_class: 'login-dialog-user-selection-box', - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER, - vertical: true, - visible: false }); + this._userSelectionBox = new St.BoxLayout({ + style_class: 'login-dialog-user-selection-box', + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + vertical: true, + visible: false, + }); this.add_child(this._userSelectionBox); this._userList = new UserList(); @@ -477,17 +485,21 @@ var LoginDialog = GObject.registerClass({ this._userSelectionBox.add_child(this._notListedButton); - this._bannerView = new St.ScrollView({ style_class: 'login-dialog-banner-view', - opacity: 0, - vscrollbar_policy: St.PolicyType.AUTOMATIC, - hscrollbar_policy: St.PolicyType.NEVER }); + this._bannerView = new St.ScrollView({ + style_class: 'login-dialog-banner-view', + opacity: 0, + vscrollbar_policy: St.PolicyType.AUTOMATIC, + hscrollbar_policy: St.PolicyType.NEVER, + }); this.add_child(this._bannerView); let bannerBox = new St.BoxLayout({ vertical: true }); this._bannerView.add_actor(bannerBox); - this._bannerLabel = new St.Label({ style_class: 'login-dialog-banner', - text: '' }); + this._bannerLabel = new St.Label({ + style_class: 'login-dialog-banner', + text: '', + }); this._bannerLabel.clutter_text.line_wrap = true; this._bannerLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; bannerBox.add_child(this._bannerLabel); @@ -502,9 +514,11 @@ var LoginDialog = GObject.registerClass({ this._sessionMenuButton.show(); this.add_child(this._sessionMenuButton); - this._logoBin = new St.Widget({ style_class: 'login-dialog-logo-bin', - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.END }); + this._logoBin = new St.Widget({ + style_class: 'login-dialog-logo-bin', + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.END, + }); this._logoBin.connect('resource-scale-changed', () => { this._updateLogoTexture(this._textureCache, this._logoFile); }); diff --git a/js/gdm/oVirt.js b/js/gdm/oVirt.js index 94a22b823..21b43b246 100644 --- a/js/gdm/oVirt.js +++ b/js/gdm/oVirt.js @@ -21,12 +21,14 @@ const OVirtCredentialsInfo = Gio.DBusInterfaceInfo.new_for_xml(OVirtCredentialsI let _oVirtCredentialsManager = null; function OVirtCredentials() { - var self = new Gio.DBusProxy({ g_connection: Gio.DBus.system, - g_interface_name: OVirtCredentialsInfo.name, - g_interface_info: OVirtCredentialsInfo, - g_name: 'org.ovirt.vdsm.Credentials', - g_object_path: '/org/ovirt/vdsm/Credentials', - g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES }); + var self = new Gio.DBusProxy({ + g_connection: Gio.DBus.system, + g_interface_name: OVirtCredentialsInfo.name, + g_interface_info: OVirtCredentialsInfo, + g_name: 'org.ovirt.vdsm.Credentials', + g_object_path: '/org/ovirt/vdsm/Credentials', + g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES, + }); self.init(null); return self; } diff --git a/js/gdm/util.js b/js/gdm/util.js index 771cd18fb..959fd44ba 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -112,8 +112,10 @@ function cloneAndFadeOutActor(actor) { // and reveals its sibling. actor.hide(); - let clone = new Clutter.Clone({ source: actor, - reactive: false }); + const clone = new Clutter.Clone({ + source: actor, + reactive: false, + }); Main.uiGroup.add_child(clone); diff --git a/js/gdm/vmware.js b/js/gdm/vmware.js index fb80a78a2..20d40743e 100644 --- a/js/gdm/vmware.js +++ b/js/gdm/vmware.js @@ -24,12 +24,14 @@ const VmwareCredentialsInfo = Gio.DBusInterfaceInfo.new_for_xml(VmwareCredential let _vmwareCredentialsManager = null; function VmwareCredentials() { - var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session, - g_interface_name: VmwareCredentialsInfo.name, - g_interface_info: VmwareCredentialsInfo, - g_name: dbusInterface, - g_object_path: dbusPath, - g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES }); + var self = new Gio.DBusProxy({ + g_connection: Gio.DBus.session, + g_interface_name: VmwareCredentialsInfo.name, + g_interface_info: VmwareCredentialsInfo, + g_name: dbusInterface, + g_object_path: dbusPath, + g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES, + }); self.init(null); return self; } diff --git a/js/misc/history.js b/js/misc/history.js index 415258881..af21574ce 100644 --- a/js/misc/history.js +++ b/js/misc/history.js @@ -8,9 +8,11 @@ var DEFAULT_LIMIT = 512; var HistoryManager = class { constructor(params) { - params = Params.parse(params, { gsettingsKey: null, - limit: DEFAULT_LIMIT, - entry: null }); + params = Params.parse(params, { + gsettingsKey: null, + limit: DEFAULT_LIMIT, + entry: null, + }); this._key = params.gsettingsKey; this._limit = params.limit; diff --git a/js/misc/objectManager.js b/js/misc/objectManager.js index 4c4e0b6e3..42076f21e 100644 --- a/js/misc/objectManager.js +++ b/js/misc/objectManager.js @@ -27,24 +27,28 @@ const ObjectManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(ObjectManagerIface); var ObjectManager = class { constructor(params) { - params = Params.parse(params, { connection: null, - name: null, - objectPath: null, - knownInterfaces: null, - cancellable: null, - onLoaded: null }); + params = Params.parse(params, { + connection: null, + name: null, + objectPath: null, + knownInterfaces: null, + cancellable: null, + onLoaded: null, + }); this._connection = params.connection; this._serviceName = params.name; this._managerPath = params.objectPath; this._cancellable = params.cancellable; - this._managerProxy = new Gio.DBusProxy({ g_connection: this._connection, - g_interface_name: ObjectManagerInfo.name, - g_interface_info: ObjectManagerInfo, - g_name: this._serviceName, - g_object_path: this._managerPath, - g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START }); + this._managerProxy = new Gio.DBusProxy({ + g_connection: this._connection, + g_interface_name: ObjectManagerInfo.name, + g_interface_info: ObjectManagerInfo, + g_name: this._serviceName, + g_object_path: this._managerPath, + g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START, + }); this._interfaceInfos = {}; this._objects = {}; @@ -80,12 +84,14 @@ var ObjectManager = class { return; } - let proxy = new Gio.DBusProxy({ g_connection: this._connection, - g_name: this._serviceName, - g_object_path: objectPath, - g_interface_name: interfaceName, - g_interface_info: info, - g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START }); + const proxy = new Gio.DBusProxy({ + g_connection: this._connection, + g_name: this._serviceName, + g_object_path: objectPath, + g_interface_name: interfaceName, + g_interface_info: info, + g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START, + }); try { await proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable); diff --git a/js/misc/smartcardManager.js b/js/misc/smartcardManager.js index d9b6ff474..938327238 100644 --- a/js/misc/smartcardManager.js +++ b/js/misc/smartcardManager.js @@ -27,11 +27,13 @@ function getSmartcardManager() { var SmartcardManager = class { constructor() { - this._objectManager = new ObjectManager.ObjectManager({ connection: Gio.DBus.session, - name: "org.gnome.SettingsDaemon.Smartcard", - objectPath: '/org/gnome/SettingsDaemon/Smartcard', - knownInterfaces: [SmartcardTokenIface], - onLoaded: this._onLoaded.bind(this) }); + this._objectManager = new ObjectManager.ObjectManager({ + connection: Gio.DBus.session, + name: 'org.gnome.SettingsDaemon.Smartcard', + objectPath: '/org/gnome/SettingsDaemon/Smartcard', + knownInterfaces: [SmartcardTokenIface], + onLoaded: this._onLoaded.bind(this), + }); this._insertedTokens = {}; this._loginToken = null; } diff --git a/js/misc/util.js b/js/misc/util.js index 389fdde28..8f7192f53 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -124,8 +124,10 @@ function trySpawn(argv) { } catch (err) { /* Rewrite the error in case of ENOENT */ if (err.matches(GLib.SpawnError, GLib.SpawnError.NOENT)) { - throw new GLib.SpawnError({ code: GLib.SpawnError.NOENT, - message: _("Command not found") }); + throw new GLib.SpawnError({ + code: GLib.SpawnError.NOENT, + message: _('Command not found'), + }); } else if (err instanceof GLib.Error) { // The exception from gjs contains an error string like: // Error invoking GLib.spawn_command_line_async: Failed to diff --git a/js/perf/core.js b/js/perf/core.js index f3f496b03..bd7e220f1 100644 --- a/js/perf/core.js +++ b/js/perf/core.js @@ -16,59 +16,86 @@ const Scripting = imports.ui.scripting; // on a particular system. var METRICS = { - overviewLatencyFirst: - { description: "Time to first frame after triggering overview, first time", - units: "us" }, - overviewFpsFirst: - { description: "Frame rate when going to the overview, first time", - units: "frames / s" }, - overviewLatencySubsequent: - { description: "Time to first frame after triggering overview, second time", - units: "us" }, - overviewFpsSubsequent: - { description: "Frames rate when going to the overview, second time", - units: "frames / s" }, - overviewFps5Windows: - { description: "Frames rate when going to the overview, 5 windows open", - units: "frames / s" }, - overviewFps10Windows: - { description: "Frames rate when going to the overview, 10 windows open", - units: "frames / s" }, - overviewFps5Maximized: - { description: "Frames rate when going to the overview, 5 maximized windows open", - units: "frames / s" }, - overviewFps10Maximized: - { description: "Frames rate when going to the overview, 10 maximized windows open", - units: "frames / s" }, - overviewFps5Alpha: - { description: "Frames rate when going to the overview, 5 alpha-transparent windows open", - units: "frames / s" }, - overviewFps10Alpha: - { description: "Frames rate when going to the overview, 10 alpha-transparent windows open", - units: "frames / s" }, - usedAfterOverview: - { description: "Malloc'ed bytes after the overview is shown once", - units: "B" }, - leakedAfterOverview: - { description: "Additional malloc'ed bytes the second time the overview is shown", - units: "B" }, - applicationsShowTimeFirst: - { description: "Time to switch to applications view, first time", - units: "us" }, - applicationsShowTimeSubsequent: - { description: "Time to switch to applications view, second time", - units: "us" }, + overviewLatencyFirst: { + description: 'Time to first frame after triggering overview, first time', + units: 'us', + }, + overviewFpsFirst: { + description: 'Frame rate when going to the overview, first time', + units: 'frames / s', + }, + overviewLatencySubsequent: { + description: 'Time to first frame after triggering overview, second time', + units: 'us', + }, + overviewFpsSubsequent: { + description: 'Frames rate when going to the overview, second time', + units: 'frames / s', + }, + overviewFps5Windows: { + description: 'Frames rate when going to the overview, 5 windows open', + units: 'frames / s', + }, + overviewFps10Windows: { + description: 'Frames rate when going to the overview, 10 windows open', + units: 'frames / s', + }, + overviewFps5Maximized: { + description: 'Frames rate when going to the overview, 5 maximized windows open', + units: 'frames / s', + }, + overviewFps10Maximized: { + description: 'Frames rate when going to the overview, 10 maximized windows open', + units: 'frames / s', + }, + overviewFps5Alpha: { + description: 'Frames rate when going to the overview, 5 alpha-transparent windows open', + units: 'frames / s', + }, + overviewFps10Alpha: { + description: 'Frames rate when going to the overview, 10 alpha-transparent windows open', + units: 'frames / s', + }, + usedAfterOverview: { + description: "Malloc'ed bytes after the overview is shown once", + units: 'B', + }, + leakedAfterOverview: { + description: "Additional malloc'ed bytes the second time the overview is shown", + units: 'B', + }, + applicationsShowTimeFirst: { + description: 'Time to switch to applications view, first time', + units: 'us', + }, + applicationsShowTimeSubsequent: { + description: 'Time to switch to applications view, second time', + units: 'us', + }, }; -let WINDOW_CONFIGS = [ - { width: 640, height: 480, alpha: false, maximized: false, count: 1, metric: 'overviewFpsSubsequent' }, - { width: 640, height: 480, alpha: false, maximized: false, count: 5, metric: 'overviewFps5Windows' }, - { width: 640, height: 480, alpha: false, maximized: false, count: 10, metric: 'overviewFps10Windows' }, - { width: 640, height: 480, alpha: false, maximized: true, count: 5, metric: 'overviewFps5Maximized' }, - { width: 640, height: 480, alpha: false, maximized: true, count: 10, metric: 'overviewFps10Maximized' }, - { width: 640, height: 480, alpha: true, maximized: false, count: 5, metric: 'overviewFps5Alpha' }, - { width: 640, height: 480, alpha: true, maximized: false, count: 10, metric: 'overviewFps10Alpha' }, -]; +const WINDOW_CONFIGS = [{ + width: 640, height: 480, + alpha: false, maximized: false, count: 1, metric: 'overviewFpsSubsequent', +}, { + width: 640, height: 480, + alpha: false, maximized: false, count: 5, metric: 'overviewFps5Windows', +}, { + width: 640, height: 480, + alpha: false, maximized: false, count: 10, metric: 'overviewFps10Windows', +}, { + width: 640, height: 480, + alpha: false, maximized: true, count: 5, metric: 'overviewFps5Maximized', +}, { + width: 640, height: 480, + alpha: false, maximized: true, count: 10, metric: 'overviewFps10Maximized', +}, { + width: 640, height: 480, + alpha: true, maximized: false, count: 5, metric: 'overviewFps5Alpha', +}, { + width: 640, height: 480, + alpha: true, maximized: false, count: 10, metric: 'overviewFps10Alpha', +}]; async function run() { /* eslint-disable no-await-in-loop */ @@ -96,10 +123,12 @@ async function run() { await Scripting.destroyTestWindows(); for (let k = 0; k < config.count; k++) { - await Scripting.createTestWindow({ width: config.width, - height: config.height, - alpha: config.alpha, - maximized: config.maximized }); + await Scripting.createTestWindow({ + width: config.width, + height: config.height, + alpha: config.alpha, + maximized: config.maximized, + }); } await Scripting.waitTestWindows(); diff --git a/js/perf/hwtest.js b/js/perf/hwtest.js index 8793ce8a9..63777bd9d 100644 --- a/js/perf/hwtest.js +++ b/js/perf/hwtest.js @@ -12,33 +12,40 @@ const Main = imports.ui.main; const Scripting = imports.ui.scripting; var METRICS = { - timeToDesktop: - { description: "Time from starting graphical.target to desktop showing", - units: "us" }, + timeToDesktop: { + description: 'Time from starting graphical.target to desktop showing', + units: 'us', + }, - overviewShowTime: - { description: "Time to switch to overview view, first time", - units: "us" }, + overviewShowTime: { + description: 'Time to switch to overview view, first time', + units: 'us', + }, - applicationsShowTime: - { description: "Time to switch to applications view, first time", - units: "us" }, + applicationsShowTime: { + description: 'Time to switch to applications view, first time', + units: 'us', + }, - mainViewRedrawTime: - { description: "Time to redraw the main view, full screen", - units: "us" }, + mainViewRedrawTime: { + description: 'Time to redraw the main view, full screen', + units: 'us', + }, - overviewRedrawTime: - { description: "Time to redraw the overview, full screen, 5 windows", - units: "us" }, + overviewRedrawTime: { + description: 'Time to redraw the overview, full screen, 5 windows', + units: 'us', + }, - applicationRedrawTime: - { description: "Time to redraw frame with a maximized application update", - units: "us" }, + applicationRedrawTime: { + description: 'Time to redraw frame with a maximized application update', + units: 'us', + }, - geditStartTime: - { description: "Time from gedit launch to window drawn", - units: "us" }, + geditStartTime: { + description: 'Time from gedit launch to window drawn', + units: 'us', + }, }; function waitAndDraw(milliseconds) { @@ -168,8 +175,10 @@ async function run() { await Scripting.destroyTestWindows(); Main.overview.hide(); - await Scripting.createTestWindow({ maximized: true, - redraws: true }); + await Scripting.createTestWindow({ + maximized: true, + redraws: true, + }); await Scripting.waitTestWindows(); await Scripting.sleep(1000); diff --git a/js/portalHelper/main.js b/js/portalHelper/main.js index 9f9b98718..bc9958e59 100644 --- a/js/portalHelper/main.js +++ b/js/portalHelper/main.js @@ -42,34 +42,44 @@ class PortalHeaderBar extends Gtk.HeaderBar { super._init({ show_close_button: true }); // See ephy-title-box.c in epiphany for the layout - let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL, - spacing: 0 }); + const vbox = new Gtk.Box({ + orientation: Gtk.Orientation.VERTICAL, + spacing: 0, + }); this.set_custom_title(vbox); /* TRANSLATORS: this is the title of the wifi captive portal login window */ - let titleLabel = new Gtk.Label({ label: _("Hotspot Login"), - wrap: false, - single_line_mode: true, - ellipsize: Pango.EllipsizeMode.END }); + const titleLabel = new Gtk.Label({ + label: _('Hotspot Login'), + wrap: false, + single_line_mode: true, + ellipsize: Pango.EllipsizeMode.END, + }); titleLabel.get_style_context().add_class('title'); vbox.add(titleLabel); - let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL, - spacing: 4, - halign: Gtk.Align.CENTER, - valign: Gtk.Align.BASELINE }); + const hbox = new Gtk.Box({ + orientation: Gtk.Orientation.HORIZONTAL, + spacing: 4, + halign: Gtk.Align.CENTER, + valign: Gtk.Align.BASELINE, + }); hbox.get_style_context().add_class('subtitle'); vbox.add(hbox); - this._lockImage = new Gtk.Image({ icon_size: Gtk.IconSize.MENU, - valign: Gtk.Align.BASELINE }); + this._lockImage = new Gtk.Image({ + icon_size: Gtk.IconSize.MENU, + valign: Gtk.Align.BASELINE, + }); hbox.add(this._lockImage); - this.subtitleLabel = new Gtk.Label({ wrap: false, - single_line_mode: true, - ellipsize: Pango.EllipsizeMode.END, - valign: Gtk.Align.BASELINE, - selectable: true }); + this.subtitleLabel = new Gtk.Label({ + wrap: false, + single_line_mode: true, + ellipsize: Pango.EllipsizeMode.END, + valign: Gtk.Align.BASELINE, + selectable: true, + }); this.subtitleLabel.get_style_context().add_class('subtitle'); hbox.add(this.subtitleLabel); @@ -271,9 +281,11 @@ class PortalWindow extends Gtk.ApplicationWindow { var WebPortalHelper = GObject.registerClass( class WebPortalHelper extends Gtk.Application { _init() { - super._init({ application_id: 'org.gnome.Shell.PortalHelper', - flags: Gio.ApplicationFlags.IS_SERVICE, - inactivity_timeout: 30000 }); + super._init({ + application_id: 'org.gnome.Shell.PortalHelper', + flags: Gio.ApplicationFlags.IS_SERVICE, + inactivity_timeout: 30000, + }); this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(HelperDBusInterface, this); this._queue = []; diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js index 4c2aa238f..393315d45 100644 --- a/js/ui/accessDialog.js +++ b/js/ui/accessDialog.js @@ -64,15 +64,15 @@ class AccessDialog extends ModalDialog.ModalDialog { }); content.add_child(bodyLabel); - this.addButton({ label: denyLabel, - action: () => { - this._sendResponse(DialogResponse.CANCEL); - }, - key: Clutter.KEY_Escape }); - this.addButton({ label: grantLabel, - action: () => { - this._sendResponse(DialogResponse.OK); - } }); + this.addButton({ + label: denyLabel, + action: () => this._sendResponse(DialogResponse.CANCEL), + key: Clutter.KEY_Escape, + }); + this.addButton({ + label: grantLabel, + action: () => this._sendResponse(DialogResponse.OK), + }); } open() { diff --git a/js/ui/altTab.js b/js/ui/altTab.js index adb5c96cd..f8e79a176 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -28,14 +28,16 @@ var AppIconMode = { function _createWindowClone(window, size) { let [width, height] = window.get_size(); let scale = Math.min(1.0, size / width, size / height); - return new Clutter.Clone({ source: window, - width: width * scale, - height: height * scale, - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER, - // usual hack for the usual bug in ClutterBinLayout... - x_expand: true, - y_expand: true }); + return new Clutter.Clone({ + source: window, + width: width * scale, + height: height * scale, + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + // usual hack for the usual bug in ClutterBinLayout... + x_expand: true, + y_expand: true, + }); } function getWindows(workspace) { @@ -462,10 +464,12 @@ class CyclerHighlight extends St.Widget { // We don't show an actual popup, so just provide what SwitcherPopup // expects instead of inheriting from SwitcherList var CyclerList = GObject.registerClass({ - Signals: { 'item-activated': { param_types: [GObject.TYPE_INT] }, - 'item-entered': { param_types: [GObject.TYPE_INT] }, - 'item-removed': { param_types: [GObject.TYPE_INT] }, - 'item-highlighted': { param_types: [GObject.TYPE_INT] } }, + Signals: { + 'item-activated': { param_types: [GObject.TYPE_INT] }, + 'item-entered': { param_types: [GObject.TYPE_INT] }, + 'item-removed': { param_types: [GObject.TYPE_INT] }, + 'item-highlighted': { param_types: [GObject.TYPE_INT] }, + }, }, class CyclerList extends St.Widget { highlight(index, _justOutline) { this.emit('item-highlighted', index); @@ -653,8 +657,10 @@ class WindowCyclerPopup extends CyclerPopup { var AppIcon = GObject.registerClass( class AppIcon extends St.BoxLayout { _init(app) { - super._init({ style_class: 'alt-tab-app', - vertical: true }); + super._init({ + style_class: 'alt-tab-app', + vertical: true, + }); this.app = app; this.icon = null; @@ -904,8 +910,10 @@ class ThumbnailSwitcher extends SwitcherPopup.SwitcherList { this._windows = windows; for (let i = 0; i < windows.length; i++) { - let box = new St.BoxLayout({ style_class: 'thumbnail-box', - vertical: true }); + const box = new St.BoxLayout({ + style_class: 'thumbnail-box', + vertical: true, + }); let bin = new St.Bin({ style_class: 'thumbnail' }); @@ -991,8 +999,10 @@ class ThumbnailSwitcher extends SwitcherPopup.SwitcherList { var WindowIcon = GObject.registerClass( class WindowIcon extends St.BoxLayout { _init(window, mode) { - super._init({ style_class: 'alt-tab-app', - vertical: true }); + super._init({ + style_class: 'alt-tab-app', + vertical: true, + }); this.window = window; @@ -1051,8 +1061,10 @@ class WindowSwitcher extends SwitcherPopup.SwitcherList { _init(windows, mode) { super._init(true); - this._label = new St.Label({ x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER }); + this._label = new St.Label({ + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + }); this.add_actor(this._label); this.windows = windows; diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 95bba6402..9abadaabe 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -2352,8 +2352,10 @@ var FolderIcon = GObject.registerClass({ this._name = ''; this._parentView = parentView; - this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder', - path }); + this._folder = new Gio.Settings({ + schema_id: 'org.gnome.desktop.app-folders.folder', + path, + }); this.icon = new IconGrid.BaseIcon('', { createIcon: this._createIcon.bind(this), @@ -3023,8 +3025,11 @@ var AppIcon = GObject.registerClass({ this._id = app.get_id(); this._name = app.get_name(); - this._iconContainer = new St.Widget({ layout_manager: new Clutter.BinLayout(), - x_expand: true, y_expand: true }); + this._iconContainer = new St.Widget({ + layout_manager: new Clutter.BinLayout(), + x_expand: true, + y_expand: true, + }); this.set_child(this._iconContainer); @@ -3221,8 +3226,10 @@ var AppIcon = GObject.registerClass({ let { stack } = new Error(); log(`shellWorkspaceLaunch is deprecated, use app.open_new_window() instead\n${stack}`); - params = Params.parse(params, { workspace: -1, - timestamp: 0 }); + params = Params.parse(params, { + workspace: -1, + timestamp: 0, + }); this.app.open_new_window(params.workspace); } diff --git a/js/ui/audioDeviceSelection.js b/js/ui/audioDeviceSelection.js index fb78b7922..e284772e6 100644 --- a/js/ui/audioDeviceSelection.js +++ b/js/ui/audioDeviceSelection.js @@ -90,8 +90,10 @@ var AudioDeviceSelectionDialog = GObject.registerClass({ } _addDevice(device) { - let box = new St.BoxLayout({ style_class: 'audio-selection-device-box', - vertical: true }); + const box = new St.BoxLayout({ + style_class: 'audio-selection-device-box', + vertical: true, + }); box.connect('notify::height', () => { Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { box.width = box.height; @@ -99,18 +101,24 @@ var AudioDeviceSelectionDialog = GObject.registerClass({ }); }); - let icon = new St.Icon({ style_class: 'audio-selection-device-icon', - icon_name: this._getDeviceIcon(device) }); + const icon = new St.Icon({ + style_class: 'audio-selection-device-icon', + icon_name: this._getDeviceIcon(device), + }); box.add(icon); - let label = new St.Label({ style_class: 'audio-selection-device-label', - text: this._getDeviceLabel(device), - x_align: Clutter.ActorAlign.CENTER }); + const label = new St.Label({ + style_class: 'audio-selection-device-label', + text: this._getDeviceLabel(device), + x_align: Clutter.ActorAlign.CENTER, + }); box.add(label); - let button = new St.Button({ style_class: 'audio-selection-device', - can_focus: true, - child: box }); + const button = new St.Button({ + style_class: 'audio-selection-device', + can_focus: true, + child: box, + }); this._selectionBox.add(button); button.connect('clicked', () => { diff --git a/js/ui/background.js b/js/ui/background.js index 0b53f3fd0..1b77043b9 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -163,9 +163,11 @@ var BackgroundCache = class BackgroundCache { } getAnimation(params) { - params = Params.parse(params, { file: null, - settingsSchema: null, - onLoaded: null }); + params = Params.parse(params, { + file: null, + settingsSchema: null, + onLoaded: null, + }); let animation = this._animations[params.settingsSchema]; if (animation && _fileEqual0(animation.file, params.file)) { diff --git a/js/ui/closeDialog.js b/js/ui/closeDialog.js index 63a0bcfcf..317d77593 100644 --- a/js/ui/closeDialog.js +++ b/js/ui/closeDialog.js @@ -67,12 +67,16 @@ var CloseDialog = GObject.registerClass({ this._dialog.height = windowActor.height; this._dialog.contentLayout.add_child(this._createDialogContent()); - this._dialog.addButton({ label: _('Force Quit'), - action: this._onClose.bind(this), - default: true }); - this._dialog.addButton({ label: _('Wait'), - action: this._onWait.bind(this), - key: Clutter.KEY_Escape }); + this._dialog.addButton({ + label: _('Force Quit'), + action: this._onClose.bind(this), + default: true, + }); + this._dialog.addButton({ + label: _('Wait'), + action: this._onWait.bind(this), + key: Clutter.KEY_Escape, + }); global.focus_manager.add_group(this._dialog); diff --git a/js/ui/components/automountManager.js b/js/ui/components/automountManager.js index 86c3a824e..762e2befc 100644 --- a/js/ui/components/automountManager.js +++ b/js/ui/components/automountManager.js @@ -65,9 +65,11 @@ var AutomountManager = class { _startupMountAll() { let volumes = this._volumeMonitor.get_volumes(); volumes.forEach(volume => { - this._checkAndMountVolume(volume, { checkSession: false, - useMountOp: false, - allowAutorun: false }); + this._checkAndMountVolume(volume, { + checkSession: false, + useMountOp: false, + allowAutorun: false, + }); }); this._mountAllId = 0; @@ -132,9 +134,11 @@ var AutomountManager = class { } _checkAndMountVolume(volume, params) { - params = Params.parse(params, { checkSession: true, - useMountOp: true, - allowAutorun: true }); + params = Params.parse(params, { + checkSession: true, + useMountOp: true, + allowAutorun: true, + }); if (params.checkSession) { // if we're not in the current ConsoleKit session, diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js index f26a2e5f7..df7cd4221 100644 --- a/js/ui/components/autorunManager.js +++ b/js/ui/components/autorunManager.js @@ -323,8 +323,10 @@ class AutorunNotification extends MessageTray.Notification { x_expand: true, x_align: Clutter.ActorAlign.START, }); - let icon = new St.Icon({ gicon: app.get_icon(), - style_class: 'hotplug-notification-item-icon' }); + const icon = new St.Icon({ + gicon: app.get_icon(), + style_class: 'hotplug-notification-item-icon', + }); box.add(icon); let label = new St.Bin({ @@ -335,10 +337,12 @@ class AutorunNotification extends MessageTray.Notification { }); box.add(label); - let button = new St.Button({ child: box, - x_expand: true, - button_mask: St.ButtonMask.ONE, - style_class: 'hotplug-notification-item button' }); + const button = new St.Button({ + child: box, + x_expand: true, + button_mask: St.ButtonMask.ONE, + style_class: 'hotplug-notification-item button', + }); button.connect('clicked', () => { startAppForMount(app, this._mount); diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index 82ed97890..532924ce5 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -598,9 +598,11 @@ var VPNRequestHandler = class { if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2) throw new Error('Invalid plugin keyfile version, is %d'); - contentOverride = { title: keyfile.get_string(VPN_UI_GROUP, 'Title'), - message: keyfile.get_string(VPN_UI_GROUP, 'Description'), - secrets: [] }; + contentOverride = { + title: keyfile.get_string(VPN_UI_GROUP, 'Title'), + message: keyfile.get_string(VPN_UI_GROUP, 'Description'), + secrets: [], + }; let [groups, len_] = keyfile.get_groups(); for (let i = 0; i < groups.length; i++) { diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index eda2e237c..4f416c27c 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -1,8 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported Component */ -const { AccountsService, Clutter, GLib, - GObject, Pango, PolkitAgent, Polkit, Shell, St } = imports.gi; +const { + AccountsService, Clutter, GLib, GObject, + Pango, PolkitAgent, Polkit, Shell, St, +} = imports.gi; const Dialog = imports.ui.dialog; const Main = imports.ui.main; @@ -135,12 +137,16 @@ var AuthenticationDialog = GObject.registerClass({ passwordBox.add_child(warningBox); bodyContent.add_child(passwordBox); - this._cancelButton = this.addButton({ label: _("Cancel"), - action: this.cancel.bind(this), - key: Clutter.KEY_Escape }); - this._okButton = this.addButton({ label: _("Authenticate"), - action: this._onAuthenticateButtonPressed.bind(this), - reactive: false }); + this._cancelButton = this.addButton({ + label: _('Cancel'), + action: this.cancel.bind(this), + key: Clutter.KEY_Escape, + }); + this._okButton = this.addButton({ + label: _('Authenticate'), + action: this._onAuthenticateButtonPressed.bind(this), + reactive: false, + }); this._okButton.bind_property('reactive', this._okButton, 'can-focus', GObject.BindingFlags.SYNC_CREATE); @@ -168,8 +174,10 @@ var AuthenticationDialog = GObject.registerClass({ _initiateSession() { this._destroySession(DELAYED_RESET_TIMEOUT); - this._session = new PolkitAgent.Session({ identity: this._identityToAuth, - cookie: this._cookie }); + this._session = new PolkitAgent.Session({ + identity: this._identityToAuth, + cookie: this._cookie, + }); this._sessionCompletedId = this._session.connect('completed', this._onSessionCompleted.bind(this)); this._sessionRequestId = this._session.connect('request', this._onSessionRequest.bind(this)); this._sessionShowErrorId = this._session.connect('show-error', this._onSessionShowError.bind(this)); diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index e0719a465..1252654fe 100644 --- a/js/ui/components/telepathyClient.js +++ b/js/ui/components/telepathyClient.js @@ -156,9 +156,11 @@ class TelepathyClient extends Tp.BaseClient { // channel matching its filters is detected. // The second argument, recover, means _observeChannels will be run // for any existing channel as well. - super._init({ name: 'GnomeShell', - account_manager: this._accountManager, - uniquify_name: true }); + super._init({ + name: 'GnomeShell', + account_manager: this._accountManager, + uniquify_name: true, + }); // We only care about single-user text-based chats let filter = {}; @@ -255,16 +257,20 @@ class TelepathyClient extends Tp.BaseClient { let chanType = channel.get_channel_type(); if (channel.get_invalidated()) { - context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT, - message: 'Channel is invalidated' })); + context.fail(new Tp.Error({ + code: Tp.Error.INVALID_ARGUMENT, + message: 'Channel is invalidated', + })); return; } if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT) { this._approveTextChannel(account, conn, channel, dispatchOp, context); } else { - context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT, - message: 'Unsupported channel type' })); + context.fail(new Tp.Error({ + code: Tp.Error.INVALID_ARGUMENT, + message: 'Unsupported channel type', + })); } } @@ -272,8 +278,10 @@ class TelepathyClient extends Tp.BaseClient { let [targetHandle_, targetHandleType] = channel.get_handle(); if (targetHandleType != Tp.HandleType.CONTACT) { - context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT, - message: 'Unsupported handle type' })); + context.fail(new Tp.Error({ + code: Tp.Error.INVALID_ARGUMENT, + message: 'Unsupported handle type', + })); return; } @@ -709,19 +717,22 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({ } if (message.direction == NotificationDirection.RECEIVED) { - this.update(this.source.title, messageBody, - { datetime: GLib.DateTime.new_from_unix_local(message.timestamp), - bannerMarkup: true }); + this.update(this.source.title, messageBody, { + datetime: GLib.DateTime.new_from_unix_local(message.timestamp), + bannerMarkup: true, + }); } let group = message.direction == NotificationDirection.RECEIVED ? 'received' : 'sent'; - this._append({ body: messageBody, - group, - styles, - timestamp: message.timestamp, - noTimestamp }); + this._append({ + body: messageBody, + group, + styles, + timestamp: message.timestamp, + noTimestamp, + }); } _filterMessages() { @@ -761,11 +772,13 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({ */ _append(props) { let currentTime = Date.now() / 1000; - props = Params.parse(props, { body: null, - group: null, - styles: [], - timestamp: currentTime, - noTimestamp: false }); + props = Params.parse(props, { + body: null, + group: null, + styles: [], + timestamp: currentTime, + noTimestamp: false, + }); const { noTimestamp } = props; delete props.noTimestamp; @@ -821,9 +834,11 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({ const message = `${ _('%s is now known as %s').format(oldAlias, newAlias)}`; - this._append({ body: message, - group: 'meta', - styles: ['chat-meta-message'] }); + this._append({ + body: message, + group: 'meta', + styles: ['chat-meta-message'], + }); this._filterMessages(); } @@ -842,9 +857,11 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner { _init(notification) { super._init(notification); - this._responseEntry = new St.Entry({ style_class: 'chat-response', - x_expand: true, - can_focus: true }); + this._responseEntry = new St.Entry({ + style_class: 'chat-response', + x_expand: true, + can_focus: true, + }); this._responseEntry.clutter_text.connect('activate', this._onEntryActivated.bind(this)); this._responseEntry.clutter_text.connect('text-changed', this._onEntryChanged.bind(this)); this.setActionArea(this._responseEntry); @@ -857,12 +874,16 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner { this.emit('unfocused'); }); - this._scrollArea = new St.ScrollView({ style_class: 'chat-scrollview vfade', - vscrollbar_policy: St.PolicyType.AUTOMATIC, - hscrollbar_policy: St.PolicyType.NEVER, - visible: this.expanded }); - this._contentArea = new St.BoxLayout({ style_class: 'chat-body', - vertical: true }); + this._scrollArea = new St.ScrollView({ + style_class: 'chat-scrollview vfade', + vscrollbar_policy: St.PolicyType.AUTOMATIC, + hscrollbar_policy: St.PolicyType.NEVER, + visible: this.expanded, + }); + this._contentArea = new St.BoxLayout({ + style_class: 'chat-body', + vertical: true, + }); this._scrollArea.add_actor(this._contentArea); this.setExpandedBody(this._scrollArea); diff --git a/js/ui/ctrlAltTab.js b/js/ui/ctrlAltTab.js index fbc7a0f5f..421fecf37 100644 --- a/js/ui/ctrlAltTab.js +++ b/js/ui/ctrlAltTab.js @@ -18,15 +18,20 @@ var SortGroup = { var CtrlAltTabManager = class CtrlAltTabManager { constructor() { this._items = []; - this.addGroup(global.window_group, _("Windows"), - 'focus-windows-symbolic', { sortGroup: SortGroup.TOP, - focusCallback: this._focusWindows.bind(this) }); + this.addGroup(global.window_group, + _('Windows'), + 'focus-windows-symbolic', { + sortGroup: SortGroup.TOP, + focusCallback: this._focusWindows.bind(this), + }); } addGroup(root, name, icon, params) { - let item = Params.parse(params, { sortGroup: SortGroup.MIDDLE, - proxy: root, - focusCallback: null }); + const item = Params.parse(params, { + sortGroup: SortGroup.MIDDLE, + proxy: root, + focusCallback: null, + }); item.root = root; item.name = name; @@ -100,14 +105,16 @@ var CtrlAltTabManager = class CtrlAltTabManager { } } - items.push({ name: windows[i].title, - proxy: windows[i].get_compositor_private(), - focusCallback: timestamp => { - Main.activateWindow(windows[i], timestamp); - }, - iconActor: icon, - iconName, - sortGroup: SortGroup.MIDDLE }); + items.push({ + name: windows[i].title, + proxy: windows[i].get_compositor_private(), + focusCallback: timestamp => { + Main.activateWindow(windows[i], timestamp); + }, + iconActor: icon, + iconName, + sortGroup: SortGroup.MIDDLE, + }); } } @@ -171,13 +178,17 @@ class CtrlAltTabSwitcher extends SwitcherPopup.SwitcherList { } _addIcon(item) { - let box = new St.BoxLayout({ style_class: 'alt-tab-app', - vertical: true }); + const box = new St.BoxLayout({ + style_class: 'alt-tab-app', + vertical: true, + }); let icon = item.iconActor; if (!icon) { - icon = new St.Icon({ icon_name: item.iconName, - icon_size: POPUP_APPICON_SIZE }); + icon = new St.Icon({ + icon_name: item.iconName, + icon_size: POPUP_APPICON_SIZE, + }); } box.add_child(icon); diff --git a/js/ui/dash.js b/js/ui/dash.js index 7c449f851..e5f81fca7 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -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]); diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 55c12ebe1..36fcc10ef 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -1,8 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported DateMenuButton */ -const { Clutter, Gio, GLib, GnomeDesktop, - GObject, GWeather, Pango, Shell, St } = imports.gi; +const { + Clutter, Gio, GLib, GnomeDesktop, + GObject, GWeather, Pango, Shell, St, +} = imports.gi; const Util = imports.misc.util; const Main = imports.ui.main; @@ -49,8 +51,10 @@ class TodayButton extends St.Button { let hbox = new St.BoxLayout({ vertical: true }); this.add_actor(hbox); - this._dayLabel = new St.Label({ style_class: 'day-label', - x_align: Clutter.ActorAlign.START }); + this._dayLabel = new St.Label({ + style_class: 'day-label', + x_align: Clutter.ActorAlign.START, + }); hbox.add_actor(this._dayLabel); this._dateLabel = new St.Label({ style_class: 'date-label' }); @@ -323,9 +327,11 @@ class WorldClocksSection extends St.Button { this._locations = []; let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL }); - this._grid = new St.Widget({ style_class: 'world-clocks-grid', - x_expand: true, - layout_manager: layout }); + this._grid = new St.Widget({ + style_class: 'world-clocks-grid', + x_expand: true, + layout_manager: layout, + }); layout.hookup_style(this._grid); this.child = this._grid; @@ -389,9 +395,11 @@ class WorldClocksSection extends St.Button { let title = this._locations.length == 0 ? _("Add world clocks…") : _("World Clocks"); - let header = new St.Label({ style_class: 'world-clocks-header', - x_align: Clutter.ActorAlign.START, - text: title }); + const header = new St.Label({ + style_class: 'world-clocks-header', + x_align: Clutter.ActorAlign.START, + text: title, + }); layout.attach(header, 0, 0, 2, 1); this.label_actor = header; @@ -399,11 +407,13 @@ class WorldClocksSection extends St.Button { let l = this._locations[i].location; let name = l.get_city_name() || l.get_name(); - let label = new St.Label({ style_class: 'world-clocks-city', - text: name, - x_align: Clutter.ActorAlign.START, - y_align: Clutter.ActorAlign.CENTER, - x_expand: true }); + const label = new St.Label({ + style_class: 'world-clocks-city', + text: name, + x_align: Clutter.ActorAlign.START, + y_align: Clutter.ActorAlign.CENTER, + x_expand: true, + }); let time = new St.Label({ style_class: 'world-clocks-time' }); @@ -821,7 +831,6 @@ var DateMenuButton = GObject.registerClass( class DateMenuButton extends PanelMenu.Button { _init() { let hbox; - let vbox; super._init(0.5); @@ -882,23 +891,29 @@ class DateMenuButton extends PanelMenu.Button { // Fill up the second column const boxLayout = new CalendarColumnLayout([this._calendar, this._date]); - vbox = new St.Widget({ style_class: 'datemenu-calendar-column', - layout_manager: boxLayout }); + const vbox = new St.Widget({ + style_class: 'datemenu-calendar-column', + layout_manager: boxLayout, + }); boxLayout.hookup_style(vbox); hbox.add(vbox); vbox.add_actor(this._date); vbox.add_actor(this._calendar); - this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade', - x_expand: true, - overlay_scrollbars: true }); + this._displaysSection = new St.ScrollView({ + style_class: 'datemenu-displays-section vfade', + x_expand: true, + overlay_scrollbars: true, + }); this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL); vbox.add_actor(this._displaysSection); - let displaysBox = new St.BoxLayout({ vertical: true, - x_expand: true, - style_class: 'datemenu-displays-box' }); + const displaysBox = new St.BoxLayout({ + vertical: true, + x_expand: true, + style_class: 'datemenu-displays-box', + }); this._displaysSection.add_actor(displaysBox); this._eventsItem = new EventsSection(); diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index f4227c2e0..94e0bef24 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -17,8 +17,10 @@ * along with this program; if not, see . */ -const { AccountsService, Clutter, Gio, - GLib, GObject, Pango, Polkit, Shell, St, UPowerGlib: UPower } = imports.gi; +const { + AccountsService, Clutter, Gio, GLib, GObject, + Pango, Polkit, Shell, St, UPowerGlib: UPower, +} = imports.gi; const CheckBox = imports.ui.checkBox; const Dialog = imports.ui.dialog; @@ -226,8 +228,10 @@ function init() { var EndSessionDialog = GObject.registerClass( class EndSessionDialog extends ModalDialog.ModalDialog { _init() { - super._init({ styleClass: 'end-session-dialog', - destroyOnClose: false }); + super._init({ + styleClass: 'end-session-dialog', + destroyOnClose: false, + }); this._loginManager = LoginManager.getLoginManager(); this._loginManager.canRebootToBootLoaderMenu( @@ -434,9 +438,11 @@ class EndSessionDialog extends ModalDialog.ModalDialog { _updateButtons() { this.clearButtons(); - this.addButton({ action: this.cancel.bind(this), - label: _("Cancel"), - key: Clutter.KEY_Escape }); + this.addButton({ + action: this.cancel.bind(this), + label: _('Cancel'), + key: Clutter.KEY_Escape, + }); let dialogContent = DialogContent[this._type]; for (let i = 0; i < dialogContent.confirmButtons.length; i++) { @@ -669,10 +675,12 @@ class EndSessionDialog extends ModalDialog.ModalDialog { if (proxy.Id == sessionId) continue; - let session = { user: this._userManager.get_user(userName), - username: userName, - type: proxy.Type, - remote: proxy.Remote }; + const session = { + user: this._userManager.get_user(userName), + username: userName, + type: proxy.Type, + remote: proxy.Remote, + }; this._sessions.push(session); let userAvatar = new UserWidget.Avatar(session.user, { iconSize: _ITEM_ICON_SIZE }); diff --git a/js/ui/environment.js b/js/ui/environment.js index e1225257b..099cf10f6 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -327,8 +327,10 @@ function init() { // Miscellaneous monkeypatching _patchContainerClass(St.BoxLayout); - _patchLayoutClass(Clutter.GridLayout, { row_spacing: 'spacing-rows', - column_spacing: 'spacing-columns' }); + _patchLayoutClass(Clutter.GridLayout, { + row_spacing: 'spacing-rows', + column_spacing: 'spacing-columns', + }); _patchLayoutClass(Clutter.BoxLayout, { spacing: 'spacing' }); let origSetEasingDuration = Clutter.Actor.prototype.set_easing_duration; diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js index 05fe82a31..a46bab0fa 100644 --- a/js/ui/grabHelper.js +++ b/js/ui/grabHelper.js @@ -111,9 +111,11 @@ var GrabHelper = class GrabHelper { // use cases like menus, where we want to grab the menu actor, but keep // focus on the clicked on menu item. grab(params) { - params = Params.parse(params, { actor: null, - focus: null, - onUngrab: null }); + params = Params.parse(params, { + actor: null, + focus: null, + onUngrab: null, + }); let focus = global.stage.key_focus; let hadFocus = focus && this._isWithinGrabbedActor(focus); @@ -202,8 +204,10 @@ var GrabHelper = class GrabHelper { // The onUngrab callback for every grab is called for every popped // grab with the parameter %false. ungrab(params) { - params = Params.parse(params, { actor: this.currentGrab.actor, - isUser: false }); + params = Params.parse(params, { + actor: this.currentGrab.actor, + isUser: false, + }); let grabStackIndex = this._findStackIndex(params.actor); if (grabStackIndex < 0) diff --git a/js/ui/ibusCandidatePopup.js b/js/ui/ibusCandidatePopup.js index 68c14b8bb..22bff9f9e 100644 --- a/js/ui/ibusCandidatePopup.js +++ b/js/ui/ibusCandidatePopup.js @@ -34,9 +34,11 @@ var CandidateArea = GObject.registerClass({ }); this._candidateBoxes = []; for (let i = 0; i < MAX_CANDIDATES_PER_PAGE; ++i) { - let box = new St.BoxLayout({ style_class: 'candidate-box', - reactive: true, - track_hover: true }); + const box = new St.BoxLayout({ + style_class: 'candidate-box', + reactive: true, + track_hover: true, + }); box._indexLabel = new St.Label({ style_class: 'candidate-index' }); box._candidateLabel = new St.Label({ style_class: 'candidate-label' }); box.add_child(box._indexLabel); @@ -155,16 +157,22 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer { Main.layoutManager.addChrome(this); - let box = new St.BoxLayout({ style_class: 'candidate-popup-content', - vertical: true }); + const box = new St.BoxLayout({ + style_class: 'candidate-popup-content', + vertical: true, + }); this.bin.set_child(box); - this._preeditText = new St.Label({ style_class: 'candidate-popup-text', - visible: false }); + this._preeditText = new St.Label({ + style_class: 'candidate-popup-text', + visible: false, + }); box.add(this._preeditText); - this._auxText = new St.Label({ style_class: 'candidate-popup-text', - visible: false }); + this._auxText = new St.Label({ + style_class: 'candidate-popup-text', + visible: false, + }); box.add(this._auxText); this._candidateArea = new CandidateArea(); diff --git a/js/ui/inhibitShortcutsDialog.js b/js/ui/inhibitShortcutsDialog.js index 84081a9c5..dec522c83 100644 --- a/js/ui/inhibitShortcutsDialog.js +++ b/js/ui/inhibitShortcutsDialog.js @@ -97,19 +97,23 @@ var InhibitShortcutsDialog = GObject.registerClass({ this._dialog.contentLayout.add_child(content); - this._dialog.addButton({ label: _("Deny"), - action: () => { - this._saveToPermissionStore(DENIED); - this._emitResponse(DialogResponse.DENY); - }, - key: Clutter.KEY_Escape }); + this._dialog.addButton({ + label: _('Deny'), + action: () => { + this._saveToPermissionStore(DENIED); + this._emitResponse(DialogResponse.DENY); + }, + key: Clutter.KEY_Escape, + }); - this._dialog.addButton({ label: _("Allow"), - action: () => { - this._saveToPermissionStore(GRANTED); - this._emitResponse(DialogResponse.ALLOW); - }, - default: true }); + this._dialog.addButton({ + label: _('Allow'), + action: () => { + this._saveToPermissionStore(GRANTED); + this._emitResponse(DialogResponse.ALLOW); + }, + default: true, + }); } _emitResponse(response) { diff --git a/js/ui/kbdA11yDialog.js b/js/ui/kbdA11yDialog.js index a45e02443..920be0016 100644 --- a/js/ui/kbdA11yDialog.js +++ b/js/ui/kbdA11yDialog.js @@ -51,21 +51,25 @@ class KbdA11yDialog extends GObject.Object { let content = new Dialog.MessageDialogContent({ title, description }); dialog.contentLayout.add_child(content); - dialog.addButton({ label: enabled ? _("Leave On") : _("Turn On"), - action: () => { - this._a11ySettings.set_boolean(key, true); - dialog.close(); - }, - default: enabled, - key: !enabled ? Clutter.KEY_Escape : null }); + dialog.addButton({ + label: enabled ? _('Leave On') : _('Turn On'), + action: () => { + this._a11ySettings.set_boolean(key, true); + dialog.close(); + }, + default: enabled, + key: !enabled ? Clutter.KEY_Escape : null, + }); - dialog.addButton({ label: enabled ? _("Turn Off") : _("Leave Off"), - action: () => { - this._a11ySettings.set_boolean(key, false); - dialog.close(); - }, - default: !enabled, - key: enabled ? Clutter.KEY_Escape : null }); + dialog.addButton({ + label: enabled ? _('Turn Off') : _('Leave Off'), + action: () => { + this._a11ySettings.set_boolean(key, false); + dialog.close(); + }, + default: !enabled, + key: enabled ? Clutter.KEY_Escape : null, + }); dialog.open(); } diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 75df02de6..6ee82a302 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -127,9 +127,11 @@ class AspectContainer extends St.Widget { var KeyContainer = GObject.registerClass( class KeyContainer extends St.Widget { _init() { - let gridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.HORIZONTAL, - column_homogeneous: true, - row_homogeneous: true }); + const gridLayout = new Clutter.GridLayout({ + orientation: Clutter.Orientation.HORIZONTAL, + column_homogeneous: true, + row_homogeneous: true, + }); super._init({ layout_manager: gridLayout, x_expand: true, @@ -880,13 +882,17 @@ var EmojiPager = GObject.registerClass({ } _generatePanel(nPage) { - let gridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.HORIZONTAL, - column_homogeneous: true, - row_homogeneous: true }); - let panel = new St.Widget({ layout_manager: gridLayout, - style_class: 'emoji-page', - x_expand: true, - y_expand: true }); + const gridLayout = new Clutter.GridLayout({ + orientation: Clutter.Orientation.HORIZONTAL, + column_homogeneous: true, + row_homogeneous: true, + }); + const panel = new St.Widget({ + layout_manager: gridLayout, + style_class: 'emoji-page', + x_expand: true, + y_expand: true, + }); /* Set an expander actor so all proportions are right despite the panel * not having all rows/cols filled in. @@ -1119,8 +1125,11 @@ var EmojiSelection = GObject.registerClass({ row.appendKey(key); row.layoutButtons(); - let actor = new AspectContainer({ layout_manager: new Clutter.BinLayout(), - x_expand: true, y_expand: true }); + const actor = new AspectContainer({ + layout_manager: new Clutter.BinLayout(), + x_expand: true, + y_expand: true, + }); actor.add_child(row); /* Regular keyboard layouts are 11.5×4 grids, optimize for that * at the moment. Ideally this should be as wide as the current @@ -1159,9 +1168,11 @@ var Keypad = GObject.registerClass({ y_expand: true, }); - let gridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.HORIZONTAL, - column_homogeneous: true, - row_homogeneous: true }); + const gridLayout = new Clutter.GridLayout({ + orientation: Clutter.Orientation.HORIZONTAL, + column_homogeneous: true, + row_homogeneous: true, + }); this._box = new St.Widget({ layout_manager: gridLayout, x_expand: true, y_expand: true }); this.add_child(this._box); diff --git a/js/ui/layout.js b/js/ui/layout.js index 68941049d..d03a72dbd 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -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); diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index bff753ec5..96f4d9cd7 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -1,8 +1,9 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported LookingGlass */ -const { Clutter, Cogl, Gio, GLib, GObject, - Graphene, Meta, Pango, Shell, St } = imports.gi; +const { + Clutter, Cogl, Gio, GLib, GObject, Graphene, Meta, Pango, Shell, St, +} = imports.gi; const Signals = imports.signals; const System = imports.system; @@ -94,13 +95,17 @@ var AutoComplete = class AutoComplete { let [completions, attrHead] = JsParse.getCompletions(text, commandHeader, AUTO_COMPLETE_GLOBAL_KEYWORDS); let currTime = global.get_current_time(); if ((currTime - this._lastTabTime) < AUTO_COMPLETE_DOUBLE_TAB_DELAY) { - this._processCompletionRequest({ tabType: 'double', - completions, - attrHead }); + this._processCompletionRequest({ + tabType: 'double', + completions, + attrHead, + }); } else { - this._processCompletionRequest({ tabType: 'single', - completions, - attrHead }); + this._processCompletionRequest({ + tabType: 'single', + completions, + attrHead, + }); } this._lastTabTime = currTime; } @@ -135,9 +140,11 @@ var Notebook = GObject.registerClass({ } appendPage(name, child) { - let labelBox = new St.BoxLayout({ style_class: 'notebook-tab', - reactive: true, - track_hover: true }); + const labelBox = new St.BoxLayout({ + style_class: 'notebook-tab', + reactive: true, + track_hover: true, + }); let label = new St.Button({ label: name }); label.connect('clicked', () => { this.selectChild(child); @@ -150,11 +157,13 @@ var Notebook = GObject.registerClass({ scrollview.get_hscroll_bar().hide(); scrollview.add_actor(child); - let tabData = { child, - labelBox, - label, - scrollView: scrollview, - _scrollToBottom: false }; + const tabData = { + child, + labelBox, + label, + scrollView: scrollview, + _scrollToBottom: false, + }; this._tabs.push(tabData); scrollview.hide(); this.add_child(scrollview); @@ -531,17 +540,21 @@ class RedBorderEffect extends Clutter.Effect { }); var Inspector = GObject.registerClass({ - Signals: { 'closed': {}, - 'target': { param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] } }, + Signals: { + 'closed': {}, + 'target': { param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, + }, }, class Inspector extends Clutter.Actor { _init(lookingGlass) { super._init({ width: 0, height: 0 }); Main.uiGroup.add_actor(this); - let eventHandler = new St.BoxLayout({ name: 'LookingGlassDialog', - vertical: false, - reactive: true }); + const eventHandler = new St.BoxLayout({ + name: 'LookingGlassDialog', + vertical: false, + reactive: true, + }); this._eventHandler = eventHandler; this.add_actor(eventHandler); this._displayText = new St.Label({ x_expand: true }); @@ -673,11 +686,15 @@ var Extensions = GObject.registerClass({ super._init({ vertical: true, name: 'lookingGlassExtensions' }); this._lookingGlass = lookingGlass; - this._noExtensions = new St.Label({ style_class: 'lg-extensions-none', - text: _("No extensions installed") }); + this._noExtensions = new St.Label({ + style_class: 'lg-extensions-none', + text: _('No extensions installed'), + }); this._numExtensions = 0; - this._extensionsList = new St.BoxLayout({ vertical: true, - style_class: 'lg-extensions-list' }); + this._extensionsList = new St.BoxLayout({ + vertical: true, + style_class: 'lg-extensions-list', + }); this._extensionsList.add(this._noExtensions); this.add(this._extensionsList); @@ -783,32 +800,40 @@ var Extensions = GObject.registerClass({ let metaBox = new St.BoxLayout({ style_class: 'lg-extension-meta' }); box.add(metaBox); - let state = new St.Label({ style_class: 'lg-extension-state', - text: this._stateToString(extension.state) }); + const state = new St.Label({ + style_class: 'lg-extension-state', + text: this._stateToString(extension.state), + }); metaBox.add(state); - let viewsource = new St.Button({ reactive: true, - track_hover: true, - style_class: 'shell-link', - label: _("View Source") }); + const viewsource = new St.Button({ + reactive: true, + track_hover: true, + style_class: 'shell-link', + label: _('View Source'), + }); viewsource._extension = extension; viewsource.connect('clicked', this._onViewSource.bind(this)); metaBox.add(viewsource); if (extension.metadata.url) { - let webpage = new St.Button({ reactive: true, - track_hover: true, - style_class: 'shell-link', - label: _("Web Page") }); + const webpage = new St.Button({ + reactive: true, + track_hover: true, + style_class: 'shell-link', + label: _('Web Page'), + }); webpage._extension = extension; webpage.connect('clicked', this._onWebPage.bind(this)); metaBox.add(webpage); } - let viewerrors = new St.Button({ reactive: true, - track_hover: true, - style_class: 'shell-link', - label: _("Show Errors") }); + const viewerrors = new St.Button({ + reactive: true, + track_hover: true, + style_class: 'shell-link', + label: _('Show Errors'), + }); viewerrors._extension = extension; viewerrors._parentBox = box; viewerrors._isShowing = false; @@ -1358,8 +1383,10 @@ class LookingGlass extends St.BoxLayout { return true; }); - this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY, - entry: this._entry.clutter_text }); + this._history = new History.HistoryManager({ + gsettingsKey: HISTORY_KEY, + entry: this._entry.clutter_text, + }); this._autoComplete = new AutoComplete(this._entry); this._autoComplete.connect('suggest', (a, e) => { diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index da4c53f8e..bd66bc479 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -1,7 +1,8 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- -const { Atspi, Clutter, GDesktopEnums, - Gio, GLib, GObject, Meta, Shell, St } = imports.gi; +const { + Atspi, Clutter, GDesktopEnums, Gio, GLib, GObject, Meta, Shell, St, +} = imports.gi; const Signals = imports.signals; const Background = imports.ui.background; @@ -884,10 +885,12 @@ var ZoomRegion = class ZoomRegion { * magnification factor to of the magnified view. */ setMagFactor(xMagFactor, yMagFactor) { - this._changeROI({ xMagFactor, - yMagFactor, - redoCursorTracking: this._followingCursor, - animate: true }); + this._changeROI({ + xMagFactor, + yMagFactor, + redoCursorTracking: this._followingCursor, + animate: true, + }); } /** @@ -981,10 +984,12 @@ var ZoomRegion = class ZoomRegion { return; this._followingCursor = false; - this._changeROI({ xMagFactor: this._viewPortWidth / roi.width, - yMagFactor: this._viewPortHeight / roi.height, - xCenter: roi.x + roi.width / 2, - yCenter: roi.y + roi.height / 2 }); + this._changeROI({ + xMagFactor: this._viewPortWidth / roi.width, + yMagFactor: this._viewPortHeight / roi.height, + xCenter: roi.x + roi.width / 2, + yCenter: roi.y + roi.height / 2, + }); } /** @@ -1209,9 +1214,11 @@ var ZoomRegion = class ZoomRegion { this._clearScrollContentsTimer(); this._followingCursor = false; - this._changeROI({ xCenter: x, - yCenter: y, - animate: true }); + this._changeROI({ + xCenter: x, + yCenter: y, + animate: true, + }); } /** @@ -1345,8 +1352,10 @@ var ZoomRegion = class ZoomRegion { // Clone the group that contains all of UI on the screen. This is the // chrome, the windows, etc. - this._uiGroupClone = new Clutter.Clone({ source: Main.uiGroup, - clip_to_allocation: true }); + this._uiGroupClone = new Clutter.Clone({ + source: Main.uiGroup, + clip_to_allocation: true, + }); mainGroup.add_actor(this._uiGroupClone); // Add either the given mouseSourceActor to the ZoomRegion, or a clone of @@ -1419,12 +1428,14 @@ var ZoomRegion = class ZoomRegion { // and center can be set explicitly, or we can recompute // the position based on the mouse cursor position - params = Params.parse(params, { xMagFactor: this._xMagFactor, - yMagFactor: this._yMagFactor, - xCenter: this._xCenter, - yCenter: this._yCenter, - redoCursorTracking: false, - animate: false }); + params = Params.parse(params, { + xMagFactor: this._xMagFactor, + yMagFactor: this._yMagFactor, + xCenter: this._xCenter, + yCenter: this._yCenter, + redoCursorTracking: false, + animate: false, + }); if (params.xMagFactor <= 0) params.xMagFactor = this._xMagFactor; @@ -1457,10 +1468,12 @@ var ZoomRegion = class ZoomRegion { // over the actual mouse. However, in full screen mode, the "lens" is // the size of the screen -- pointless to move such a large lens around. if (this._lensMode && !this._isFullScreen()) { - this._setViewPort({ x: this._xCenter - this._viewPortWidth / 2, - y: this._yCenter - this._viewPortHeight / 2, - width: this._viewPortWidth, - height: this._viewPortHeight }, true); + this._setViewPort({ + x: this._xCenter - this._viewPortWidth / 2, + y: this._yCenter - this._viewPortHeight / 2, + width: this._viewPortWidth, + height: this._viewPortHeight, + }, true); } this._updateCloneGeometry(params.animate); diff --git a/js/ui/main.js b/js/ui/main.js index 3d7a044c4..76223b9c2 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -555,9 +555,11 @@ function _findModal(grab) { * @returns {Clutter.Grab}: the grab handle created */ function pushModal(actor, params) { - params = Params.parse(params, { timestamp: global.get_current_time(), - options: 0, - actionMode: Shell.ActionMode.NONE }); + params = Params.parse(params, { + timestamp: global.get_current_time(), + options: 0, + actionMode: Shell.ActionMode.NONE, + }); let grab = global.stage.grab(actor); @@ -582,7 +584,8 @@ function pushModal(actor, params) { modalActorFocusStack[index].prevFocus = null; }); } - modalActorFocusStack.push({ actor, + modalActorFocusStack.push({ + actor, grab, destroyId: actorDestroyId, prevFocus, @@ -788,8 +791,10 @@ function _queueBeforeRedraw(workId) { function initializeDeferredWork(actor, callback) { // Turn into a string so we can use as an object property let workId = `${++_deferredWorkSequence}`; - _deferredWorkData[workId] = { actor, - callback }; + _deferredWorkData[workId] = { + actor, + callback, + }; actor.connect('notify::mapped', () => { if (!(actor.mapped && _deferredWorkQueue.includes(workId))) return; @@ -838,10 +843,12 @@ function queueDeferredWork(workId) { var RestartMessage = GObject.registerClass( class RestartMessage extends ModalDialog.ModalDialog { _init(message) { - super._init({ shellReactive: true, - styleClass: 'restart-message headline', - shouldFadeIn: false, - destroyOnClose: true }); + super._init({ + shellReactive: true, + styleClass: 'restart-message headline', + shouldFadeIn: false, + destroyOnClose: true, + }); let label = new St.Label({ text: message, diff --git a/js/ui/messageList.js b/js/ui/messageList.js index a8431ac54..fb87fbdc7 100644 --- a/js/ui/messageList.js +++ b/js/ui/messageList.js @@ -1,6 +1,7 @@ /* exported MessageListSection */ -const { Atk, Clutter, Gio, GLib, - GObject, Graphene, Meta, Pango, St } = imports.gi; +const { + Atk, Clutter, Gio, GLib, GObject, Graphene, Meta, Pango, St, +} = imports.gi; const Main = imports.ui.main; const MessageTray = imports.ui.messageTray; @@ -331,18 +332,25 @@ var Message = GObject.registerClass({ let hbox = new St.BoxLayout(); vbox.add_actor(hbox); - this._actionBin = new St.Widget({ layout_manager: new ScaleLayout(), - visible: false }); + this._actionBin = new St.Widget({ + layout_manager: new ScaleLayout(), + visible: false, + }); vbox.add_actor(this._actionBin); - this._iconBin = new St.Bin({ style_class: 'message-icon-bin', - y_expand: true, - y_align: Clutter.ActorAlign.START, - visible: false }); + this._iconBin = new St.Bin({ + style_class: 'message-icon-bin', + y_expand: true, + y_align: Clutter.ActorAlign.START, + visible: false, + }); hbox.add_actor(this._iconBin); - let contentBox = new St.BoxLayout({ style_class: 'message-content', - vertical: true, x_expand: true }); + const contentBox = new St.BoxLayout({ + style_class: 'message-content', + vertical: true, + x_expand: true, + }); hbox.add_actor(contentBox); this._mediaControls = new St.BoxLayout(); @@ -361,8 +369,10 @@ var Message = GObject.registerClass({ }); titleBox.add_actor(this._secondaryBin); - let closeIcon = new St.Icon({ icon_name: 'window-close-symbolic', - icon_size: 16 }); + const closeIcon = new St.Icon({ + icon_name: 'window-close-symbolic', + icon_size: 16, + }); this._closeButton = new St.Button({ style_class: 'message-close-button', child: closeIcon, opacity: 0, @@ -435,8 +445,10 @@ var Message = GObject.registerClass({ addMediaControl(iconName, callback) { let icon = new St.Icon({ icon_name: iconName, icon_size: 16 }); - let button = new St.Button({ style_class: 'message-media-control', - child: icon }); + const button = new St.Button({ + style_class: 'message-media-control', + child: icon, + }); button.connect('clicked', callback); this._mediaControls.add_actor(button); return button; @@ -565,8 +577,10 @@ var MessageListSection = GObject.registerClass({ x_expand: true, }); - this._list = new St.BoxLayout({ style_class: 'message-list-section-list', - vertical: true }); + this._list = new St.BoxLayout({ + style_class: 'message-list-section-list', + vertical: true, + }); this.add_actor(this._list); this._list.connect('actor-added', this._sync.bind(this)); diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 562d55636..edb5ad148 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -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', diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 607000b35..6d1d45ceb 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -31,19 +31,22 @@ var ModalDialog = GObject.registerClass({ Signals: { 'opened': {}, 'closed': {} }, }, class ModalDialog extends St.Widget { _init(params) { - super._init({ visible: false, + super._init({ + visible: false, reactive: true, x: 0, y: 0, accessible_role: Atk.Role.DIALOG, }); - params = Params.parse(params, { shellReactive: false, - styleClass: null, - actionMode: Shell.ActionMode.SYSTEM_MODAL, - shouldFadeIn: true, - shouldFadeOut: true, - destroyOnClose: true }); + params = Params.parse(params, { + shellReactive: false, + styleClass: null, + actionMode: Shell.ActionMode.SYSTEM_MODAL, + shouldFadeIn: true, + shouldFadeOut: true, + destroyOnClose: true, + }); this._state = State.CLOSED; this._hasModal = false; @@ -55,8 +58,10 @@ var ModalDialog = GObject.registerClass({ Main.layoutManager.modalDialogGroup.add_actor(this); - 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.add_constraint(constraint); this.backgroundStack = new St.Widget({ @@ -74,9 +79,10 @@ var ModalDialog = GObject.registerClass({ this.buttonLayout = this.dialogLayout.buttonLayout; if (!this._shellReactive) { - this._lightbox = new Lightbox.Lightbox(this, - { inhibitEvents: true, - radialEffect: true }); + this._lightbox = new Lightbox.Lightbox(this, { + inhibitEvents: true, + radialEffect: true, + }); this._lightbox.highlight(this._backgroundBin); this._eventBlocker = new Clutter.Actor({ reactive: true }); diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index bf886b1a6..769c12245 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -171,13 +171,15 @@ var FdoNotificationDaemon = class FdoNotificationDaemon { hints['image-data'] = hints['icon_data']; } - let ndata = { appName, - icon, - summary, - body, - actions, - hints, - timeout }; + const ndata = { + appName, + icon, + summary, + body, + actions, + hints, + timeout, + }; if (replacesId != 0 && this._notifications[replacesId]) { ndata.id = id = replacesId; ndata.notification = this._notifications[replacesId].notification; @@ -458,8 +460,10 @@ class FdoNotificationDaemonSource extends MessageTray.Source { if (this.app) { return this.app.create_icon_texture(size); } else if (this._gicon) { - return new St.Icon({ gicon: this._gicon, - icon_size: size }); + return new St.Icon({ + gicon: this._gicon, + icon_size: size, + }); } else { return null; } @@ -479,15 +483,17 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification { super._init(source); this._serialized = GLib.Variant.new('a{sv}', notification); - let { title, - body, - icon: gicon, - urgent, - priority, - buttons, - "default-action": defaultAction, - "default-action-target": defaultActionTarget, - timestamp: time } = notification; + const { + title, + body, + icon: gicon, + urgent, + priority, + buttons, + 'default-action': defaultAction, + 'default-action-target': defaultActionTarget, + timestamp: time, + } = notification; if (priority) { let urgency = PRIORITY_URGENCY_MAP[priority.unpack()]; @@ -511,9 +517,12 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification { this._defaultAction = defaultAction?.unpack(); this._defaultActionTarget = defaultActionTarget; - this.update(title.unpack(), body?.unpack(), - { gicon: gicon ? Gio.icon_deserialize(gicon) : null, - datetime: time ? GLib.DateTime.new_from_unix_local(time.unpack()) : null }); + this.update(title.unpack(), body?.unpack(), { + gicon: gicon + ? Gio.icon_deserialize(gicon) : null, + datetime: time + ? GLib.DateTime.new_from_unix_local(time.unpack()) : null, + }); } _activateAction(namespacedActionId, target) { diff --git a/js/ui/osdMonitorLabeler.js b/js/ui/osdMonitorLabeler.js index b242ecca1..9fdf3e88b 100644 --- a/js/ui/osdMonitorLabeler.js +++ b/js/ui/osdMonitorLabeler.js @@ -12,12 +12,16 @@ class OsdMonitorLabel extends St.Widget { this._monitor = monitor; - this._box = new St.BoxLayout({ style_class: 'osd-window', - vertical: true }); + this._box = new St.BoxLayout({ + style_class: 'osd-window', + vertical: true, + }); this.add_actor(this._box); - this._label = new St.Label({ style_class: 'osd-monitor-label', - text: label }); + this._label = new St.Label({ + style_class: 'osd-monitor-label', + text: label, + }); this._box.add(this._label); Main.uiGroup.add_child(this); diff --git a/js/ui/overview.js b/js/ui/overview.js index bea093572..7fd38848b 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -159,8 +159,10 @@ var Overview = class { // During transitions, we raise this to the top to avoid having the overview // area be reactive; it causes too many issues such as double clicks on // Dash elements, or mouseover handlers in the workspaces. - this._coverPane = new Clutter.Actor({ opacity: 0, - reactive: true }); + this._coverPane = new Clutter.Actor({ + opacity: 0, + reactive: true, + }); Main.layoutManager.overviewGroup.add_child(this._coverPane); this._coverPane.connect('event', (_actor, event) => { return event.type() === Clutter.EventType.ENTER || @@ -329,8 +331,11 @@ var Overview = class { return null; let window = windows[0]; - let clone = new Clutter.Clone({ source: window, - x: window.x, y: window.y }); + const clone = new Clutter.Clone({ + source: window, + x: window.x, + y: window.y, + }); clone.source.connect('destroy', () => { clone.destroy(); }); diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js index 98a028f66..67864026e 100644 --- a/js/ui/padOsd.js +++ b/js/ui/padOsd.js @@ -1,8 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported PadOsd, PadOsdService */ -const { Atk, Clutter, GDesktopEnums, Gio, - GLib, GObject, Gtk, Meta, Pango, Rsvg, St } = imports.gi; +const { + Atk, Clutter, GDesktopEnums, Gio, + GLib, GObject, Gtk, Meta, Pango, Rsvg, St, +} = imports.gi; const Signals = imports.signals; const Main = imports.ui.main; @@ -116,19 +118,23 @@ var ActionComboBox = GObject.registerClass({ super._init({ style_class: 'button' }); this.set_toggle_mode(true); - let boxLayout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.HORIZONTAL, - spacing: 6 }); + const boxLayout = new Clutter.BoxLayout({ + orientation: Clutter.Orientation.HORIZONTAL, + spacing: 6, + }); let box = new St.Widget({ layout_manager: boxLayout }); this.set_child(box); this._label = new St.Label({ style_class: 'combo-box-label' }); box.add_child(this._label); - let arrow = new St.Icon({ style_class: 'popup-menu-arrow', - icon_name: 'pan-down-symbolic', - accessible_role: Atk.Role.ARROW, - y_expand: true, - y_align: Clutter.ActorAlign.CENTER }); + const arrow = new St.Icon({ + style_class: 'popup-menu-arrow', + icon_name: 'pan-down-symbolic', + accessible_role: Atk.Role.ARROW, + y_expand: true, + y_align: Clutter.ActorAlign.CENTER, + }); box.add_child(arrow); this._editMenu = new PopupMenu.PopupMenu(this, 0, St.Side.TOP); @@ -195,8 +201,10 @@ var ActionEditor = GObject.registerClass({ Signals: { 'done': {} }, }, class ActionEditor extends St.Widget { _init() { - let boxLayout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.HORIZONTAL, - spacing: 12 }); + const boxLayout = new Clutter.BoxLayout({ + orientation: Clutter.Orientation.HORIZONTAL, + spacing: 12, + }); super._init({ layout_manager: boxLayout }); @@ -208,9 +216,11 @@ var ActionEditor = GObject.registerClass({ this._keybindingEdit.connect('keybinding-edited', this._onKeybindingEdited.bind(this)); this.add_actor(this._keybindingEdit); - this._doneButton = new St.Button({ label: _("Done"), - style_class: 'button', - x_expand: false }); + this._doneButton = new St.Button({ + label: _('Done'), + style_class: 'button', + x_expand: false, + }); this._doneButton.connect('clicked', this._onEditingDone.bind(this)); this.add_actor(this._doneButton); } @@ -675,18 +685,24 @@ var PadOsd = GObject.registerClass({ let constraint = new Layout.MonitorConstraint({ index: monitorIndex }); this.add_constraint(constraint); - this._titleBox = new St.BoxLayout({ style_class: 'pad-osd-title-box', - vertical: false, - x_expand: false, - x_align: Clutter.ActorAlign.CENTER }); + this._titleBox = new St.BoxLayout({ + style_class: 'pad-osd-title-box', + vertical: false, + x_expand: false, + x_align: Clutter.ActorAlign.CENTER, + }); this.add_actor(this._titleBox); - let labelBox = new St.BoxLayout({ style_class: 'pad-osd-title-menu-box', - vertical: true }); + const labelBox = new St.BoxLayout({ + style_class: 'pad-osd-title-menu-box', + vertical: true, + }); this._titleBox.add_actor(labelBox); - this._titleLabel = new St.Label({ style: 'font-side: larger; font-weight: bold;', - x_align: Clutter.ActorAlign.CENTER }); + this._titleLabel = new St.Label({ + style: 'font-side: larger; font-weight: bold;', + x_align: Clutter.ActorAlign.CENTER, + }); this._titleLabel.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE); this._titleLabel.clutter_text.set_text(padDevice.get_device_name()); labelBox.add_actor(this._titleLabel); @@ -699,18 +715,22 @@ var PadOsd = GObject.registerClass({ this._actionEditor = new ActionEditor(); this._actionEditor.connect('done', this._endActionEdition.bind(this)); - this._padDiagram = new PadDiagram({ image: this._imagePath, - left_handed: settings.get_boolean('left-handed'), - editor_actor: this._actionEditor, - x_expand: true, - y_expand: true }); + this._padDiagram = new PadDiagram({ + image: this._imagePath, + left_handed: settings.get_boolean('left-handed'), + editor_actor: this._actionEditor, + x_expand: true, + y_expand: true, + }); this.add_actor(this._padDiagram); this._updateActionLabels(); - let buttonBox = new St.Widget({ layout_manager: new Clutter.BinLayout(), - x_expand: true, - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER }); + const buttonBox = new St.Widget({ + layout_manager: new Clutter.BinLayout(), + x_expand: true, + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + }); this.add_actor(buttonBox); this._editButton = new St.Button({ label: _('Edit…'), diff --git a/js/ui/pageIndicators.js b/js/ui/pageIndicators.js index 63a31d679..18a376cba 100644 --- a/js/ui/pageIndicators.js +++ b/js/ui/pageIndicators.js @@ -54,11 +54,13 @@ var PageIndicators = GObject.registerClass({ if (diff > 0) { for (let i = 0; i < diff; i++) { let pageIndex = this._nPages + i; - let indicator = new St.Button({ style_class: 'page-indicator', - button_mask: St.ButtonMask.ONE | - St.ButtonMask.TWO | - St.ButtonMask.THREE, - reactive: this._reactive }); + const indicator = new St.Button({ + style_class: 'page-indicator', + button_mask: St.ButtonMask.ONE | + St.ButtonMask.TWO | + St.ButtonMask.THREE, + reactive: this._reactive, + }); indicator.child = new St.Widget({ style_class: 'page-indicator-icon', pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), diff --git a/js/ui/panel.js b/js/ui/panel.js index 78064f73f..727520637 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -66,8 +66,10 @@ var AppMenuButton = GObject.registerClass({ iconEffect.enabled = themeNode.get_icon_style() == St.IconStyle.SYMBOLIC; }); - this._label = new St.Label({ y_expand: true, - y_align: Clutter.ActorAlign.CENTER }); + this._label = new St.Label({ + y_expand: true, + y_align: Clutter.ActorAlign.CENTER, + }); this._container.add_actor(this._label); this._visible = !Main.overview.visible; @@ -267,8 +269,10 @@ class ActivitiesButton extends PanelMenu.Button { /* Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". */ - this._label = new St.Label({ text: _("Activities"), - y_align: Clutter.ActorAlign.CENTER }); + this._label = new St.Label({ + text: _('Activities'), + y_align: Clutter.ActorAlign.CENTER, + }); this.add_actor(this._label); this.label_actor = this._label; @@ -474,8 +478,10 @@ const PANEL_ITEM_IMPLEMENTATIONS = { var Panel = GObject.registerClass( class Panel extends St.Widget { _init() { - super._init({ name: 'panel', - reactive: true }); + super._init({ + name: 'panel', + reactive: true, + }); this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 5908f7a29..81ba02ce2 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -47,11 +47,13 @@ function arrowIcon(side) { break; } - let arrow = new St.Icon({ style_class: 'popup-menu-arrow', - icon_name: iconName, - accessible_role: Atk.Role.ARROW, - y_expand: true, - y_align: Clutter.ActorAlign.CENTER }); + const arrow = new St.Icon({ + style_class: 'popup-menu-arrow', + icon_name: iconName, + accessible_role: Atk.Role.ARROW, + y_expand: true, + y_align: Clutter.ActorAlign.CENTER, + }); return arrow; } @@ -77,11 +79,13 @@ var PopupBaseMenuItem = GObject.registerClass({ style_class: null, can_focus: true, }); - super._init({ style_class: 'popup-menu-item', - reactive: params.reactive, - track_hover: params.reactive, - can_focus: params.can_focus, - accessible_role: Atk.Role.MENU_ITEM }); + super._init({ + style_class: 'popup-menu-item', + reactive: params.reactive, + track_hover: params.reactive, + can_focus: params.can_focus, + accessible_role: Atk.Role.MENU_ITEM, + }); this._delegate = this; this._ornament = Ornament.NONE; @@ -451,8 +455,10 @@ class PopupImageMenuItem extends PopupBaseMenuItem { _init(text, icon, params) { super._init(params); - this._icon = new St.Icon({ style_class: 'popup-menu-icon', - x_align: Clutter.ActorAlign.END }); + this._icon = new St.Icon({ + style_class: 'popup-menu-icon', + x_align: Clutter.ActorAlign.END, + }); this.add_child(this._icon); this.label = new St.Label({ text, @@ -1024,9 +1030,11 @@ var PopupSubMenu = class extends PopupMenuBase { // Since a function of a submenu might be to provide a "More.." expander // with long content, we make it scrollable - the scrollbar will only take // effect if a CSS max-height is set on the top menu. - this.actor = new St.ScrollView({ style_class: 'popup-sub-menu', - hscrollbar_policy: St.PolicyType.NEVER, - vscrollbar_policy: St.PolicyType.NEVER }); + this.actor = new St.ScrollView({ + style_class: 'popup-sub-menu', + hscrollbar_policy: St.PolicyType.NEVER, + vscrollbar_policy: St.PolicyType.NEVER, + }); this.actor.add_actor(this.box); this.actor._delegate = this; @@ -1194,9 +1202,11 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem { this.add_child(this.icon); } - this.label = new St.Label({ text, - y_expand: true, - y_align: Clutter.ActorAlign.CENTER }); + this.label = new St.Label({ + text, + y_expand: true, + y_align: Clutter.ActorAlign.CENTER, + }); this.add_child(this.label); this.label_actor = this.label; @@ -1209,8 +1219,10 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem { this._triangle = arrowIcon(St.Side.RIGHT); this._triangle.pivot_point = new Graphene.Point({ x: 0.5, y: 0.6 }); - this._triangleBin = new St.Widget({ y_expand: true, - y_align: Clutter.ActorAlign.CENTER }); + this._triangleBin = new St.Widget({ + y_expand: true, + y_align: Clutter.ActorAlign.CENTER, + }); this._triangleBin.add_child(this._triangle); this.add_child(this._triangleBin); diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js index a31a17ff5..8ebb55052 100644 --- a/js/ui/remoteSearch.js +++ b/js/ui/remoteSearch.js @@ -198,12 +198,14 @@ var RemoteSearchProvider = class { else gFlags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START; - this.proxy = new Gio.DBusProxy({ g_bus_type: Gio.BusType.SESSION, - g_name: dbusName, - g_object_path: dbusPath, - g_interface_info: proxyInfo, - g_interface_name: proxyInfo.name, - gFlags }); + this.proxy = new Gio.DBusProxy({ + g_bus_type: Gio.BusType.SESSION, + g_name: dbusName, + g_object_path: dbusPath, + g_interface_info: proxyInfo, + g_interface_name: proxyInfo.name, + gFlags, + }); this.proxy.init_async(GLib.PRIORITY_DEFAULT, null); this.appInfo = appInfo; @@ -289,13 +291,13 @@ var RemoteSearchProvider = class { metas[i][prop] = metas[i][prop].deep_unpack(); } - resultMetas.push({ id: metas[i]['id'], - name: metas[i]['name'], - description: metas[i]['description'], - createIcon: size => { - return this.createIcon(size, metas[i]); - }, - clipboardText: metas[i]['clipboardText'] }); + resultMetas.push({ + id: metas[i]['id'], + name: metas[i]['name'], + description: metas[i]['description'], + createIcon: size => this.createIcon(size, metas[i]), + clipboardText: metas[i]['clipboardText'], + }); } callback(resultMetas); } diff --git a/js/ui/ripples.js b/js/ui/ripples.js index f38062228..20ca9ed9f 100644 --- a/js/ui/ripples.js +++ b/js/ui/ripples.js @@ -12,25 +12,31 @@ var Ripples = class Ripples { this._px = px; this._py = py; - this._ripple1 = new St.BoxLayout({ style_class: styleClass, - opacity: 0, - can_focus: false, - reactive: false, - visible: false }); + this._ripple1 = new St.BoxLayout({ + style_class: styleClass, + opacity: 0, + can_focus: false, + reactive: false, + visible: false, + }); this._ripple1.set_pivot_point(px, py); - this._ripple2 = new St.BoxLayout({ style_class: styleClass, - opacity: 0, - can_focus: false, - reactive: false, - visible: false }); + this._ripple2 = new St.BoxLayout({ + style_class: styleClass, + opacity: 0, + can_focus: false, + reactive: false, + visible: false, + }); this._ripple2.set_pivot_point(px, py); - this._ripple3 = new St.BoxLayout({ style_class: styleClass, - opacity: 0, - can_focus: false, - reactive: false, - visible: false }); + this._ripple3 = new St.BoxLayout({ + style_class: styleClass, + opacity: 0, + can_focus: false, + reactive: false, + visible: false, + }); this._ripple3.set_pivot_point(px, py); } diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index bf4bf04a8..a78172047 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -1,7 +1,9 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- -const { AccountsService, Clutter, Gio, - GLib, Graphene, Meta, Shell, St } = imports.gi; +const { + AccountsService, Clutter, Gio, + GLib, Graphene, Meta, Shell, St, +} = imports.gi; const Signals = imports.signals; const GnomeSession = imports.misc.gnomeSession; @@ -130,13 +132,15 @@ var ScreenShield = class { // The "long" lightbox is used for the longer (20 seconds) fade from session // to idle status, the "short" is used for quickly fading to black when locking // manually - this._longLightbox = new Lightbox.Lightbox(Main.uiGroup, - { inhibitEvents: true, - fadeFactor: 1 }); + this._longLightbox = new Lightbox.Lightbox(Main.uiGroup, { + inhibitEvents: true, + fadeFactor: 1, + }); this._longLightbox.connect('notify::active', this._onLongLightbox.bind(this)); - this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup, - { inhibitEvents: true, - fadeFactor: 1 }); + this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup, { + inhibitEvents: true, + fadeFactor: 1, + }); this._shortLightbox.connect('notify::active', this._onShortLightbox.bind(this)); this.idleMonitor = global.backend.get_core_idle_monitor(); @@ -440,8 +444,10 @@ var ScreenShield = class { } _onUnlockFailed() { - this._resetLockScreen({ animateLockScreen: true, - fadeToBlack: false }); + this._resetLockScreen({ + animateLockScreen: true, + fadeToBlack: false, + }); } _resetLockScreen(params) { @@ -606,8 +612,10 @@ var ScreenShield = class { Main.sessionMode.pushMode('unlock-dialog'); } - this._resetLockScreen({ animateLockScreen: animate, - fadeToBlack: true }); + this._resetLockScreen({ + animateLockScreen: animate, + fadeToBlack: true, + }); // On wayland, a crash brings down the entire session, so we don't // need to defend against being restarted unlocked if (!Meta.is_wayland_compositor()) diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index d40c5b244..63069d216 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -2542,8 +2542,10 @@ class SelectArea extends St.Widget { this._grabHelper = new GrabHelper.GrabHelper(this); - 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.add_constraint(constraint); this._rubberband = new St.Widget({ @@ -2768,8 +2770,10 @@ class PickPixel extends St.Widget { this._grabHelper = new GrabHelper.GrabHelper(this); - 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.add_constraint(constraint); const action = new Clutter.ClickAction(); diff --git a/js/ui/scripting.js b/js/ui/scripting.js index 360113076..67a2652d1 100644 --- a/js/ui/scripting.js +++ b/js/ui/scripting.js @@ -112,11 +112,13 @@ function _callRemote(obj, method, ...args) { * until the window has been mapped and exposed, use waitTestWindows(). */ function createTestWindow(params) { - params = Params.parse(params, { width: 640, - height: 480, - alpha: false, - maximized: false, - redraws: false }); + params = Params.parse(params, { + width: 640, + height: 480, + alpha: false, + maximized: false, + redraws: false, + }); let perfHelper = _getPerfHelper(); return _callRemote(perfHelper, perfHelper.CreateWindowRemote, diff --git a/js/ui/search.js b/js/ui/search.js index 1e8aeb6c7..cd5474db3 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -912,19 +912,27 @@ class ProviderInfo extends St.Button { y_align: Clutter.ActorAlign.START, }); - this._content = new St.BoxLayout({ vertical: false, - style_class: 'list-search-provider-content' }); + this._content = new St.BoxLayout({ + vertical: false, + style_class: 'list-search-provider-content', + }); this.set_child(this._content); - let icon = new St.Icon({ icon_size: this.PROVIDER_ICON_SIZE, - gicon: provider.appInfo.get_icon() }); + const icon = new St.Icon({ + icon_size: this.PROVIDER_ICON_SIZE, + gicon: provider.appInfo.get_icon(), + }); - let detailsBox = new St.BoxLayout({ style_class: 'list-search-provider-details', - vertical: true, - x_expand: true }); + const detailsBox = new St.BoxLayout({ + style_class: 'list-search-provider-details', + vertical: true, + x_expand: true, + }); - let nameLabel = new St.Label({ text: provider.appInfo.get_name(), - x_align: Clutter.ActorAlign.START }); + const nameLabel = new St.Label({ + text: provider.appInfo.get_name(), + x_align: Clutter.ActorAlign.START, + }); this._moreLabel = new St.Label({ x_align: Clutter.ActorAlign.START }); diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index 9f1e75d02..8faa112ea 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -117,11 +117,13 @@ var GnomeShell = class { for (let param in params) params[param] = params[param].deep_unpack(); - let { connector, - label, - level, - max_level: maxLevel, - icon: serializedIcon } = params; + const { + connector, + label, + level, + max_level: maxLevel, + icon: serializedIcon, + } = params; let monitorIndex = -1; if (connector) { diff --git a/js/ui/status/brightness.js b/js/ui/status/brightness.js index 17247880f..aa6020660 100644 --- a/js/ui/status/brightness.js +++ b/js/ui/status/brightness.js @@ -38,8 +38,10 @@ class Indicator extends PanelMenu.SystemIndicator { this._sliderChanged.bind(this)); this._slider.accessible_name = _("Brightness"); - let icon = new St.Icon({ icon_name: 'display-brightness-symbolic', - style_class: 'popup-menu-icon' }); + const icon = new St.Icon({ + icon_name: 'display-brightness-symbolic', + style_class: 'popup-menu-icon', + }); this._item.add(icon); this._item.add_child(this._slider); this._item.connect('button-press-event', (actor, event) => { diff --git a/js/ui/status/dwellClick.js b/js/ui/status/dwellClick.js index d82a46503..82726e5b6 100644 --- a/js/ui/status/dwellClick.js +++ b/js/ui/status/dwellClick.js @@ -35,8 +35,10 @@ class DwellClickIndicator extends PanelMenu.Button { _init() { super._init(0.5, _("Dwell Click")); - this._icon = new St.Icon({ style_class: 'system-status-icon', - icon_name: 'pointer-primary-click-symbolic' }); + this._icon = new St.Icon({ + style_class: 'system-status-icon', + icon_name: 'pointer-primary-click-symbolic', + }); this.add_child(this._icon); this._a11ySettings = new Gio.Settings({ schema_id: MOUSE_A11Y_SCHEMA }); diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index c2b5cfd6e..f7527313c 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -892,8 +892,10 @@ class InputSourceIndicator extends PanelMenu.Button { let menuItem = new LayoutMenuItem(is.displayName, is.shortName); menuItem.connect('activate', () => is.activate(true)); - let indicatorLabel = new St.Label({ text: is.shortName, - visible: false }); + const indicatorLabel = new St.Label({ + text: is.shortName, + visible: false, + }); this._menuItems[i] = menuItem; this._indicatorLabels[i] = indicatorLabel; diff --git a/js/ui/status/location.js b/js/ui/status/location.js index 7f0029218..f213d8082 100644 --- a/js/ui/status/location.js +++ b/js/ui/status/location.js @@ -413,11 +413,15 @@ var GeolocationDialog = GObject.registerClass({ this.contentLayout.add_child(content); - let button = this.addButton({ label: _("Deny Access"), - action: this._onDenyClicked.bind(this), - key: Clutter.KEY_Escape }); - this.addButton({ label: _("Grant Access"), - action: this._onGrantClicked.bind(this) }); + const button = this.addButton({ + label: _('Deny Access'), + action: this._onDenyClicked.bind(this), + key: Clutter.KEY_Escape, + }); + this.addButton({ + label: _('Grant Access'), + action: this._onGrantClicked.bind(this), + }); this.setInitialKeyFocus(button); } diff --git a/js/ui/status/network.js b/js/ui/status/network.js index f06a8fe82..4b88be547 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -700,9 +700,11 @@ var NMWirelessDialogItem = GObject.registerClass({ this._network = network; this._ap = network.accessPoints[0]; - super._init({ style_class: 'nm-dialog-item', - can_focus: true, - reactive: true }); + super._init({ + style_class: 'nm-dialog-item', + can_focus: true, + reactive: true, + }); let action = new Clutter.ClickAction(); action.connect('clicked', () => this.grab_key_focus()); @@ -717,8 +719,10 @@ var NMWirelessDialogItem = GObject.registerClass({ this.label_actor = this._label; this.add_child(this._label); - this._selectedIcon = new St.Icon({ style_class: 'nm-dialog-icon', - icon_name: 'object-select-symbolic' }); + this._selectedIcon = new St.Icon({ + style_class: 'nm-dialog-icon', + icon_name: 'object-select-symbolic', + }); this.add(this._selectedIcon); this._icons = new St.BoxLayout({ @@ -913,14 +917,20 @@ class NMWirelessDialog extends ModalDialog.ModalDialog { _buildLayout() { let headline = new St.BoxLayout({ style_class: 'nm-dialog-header-hbox' }); - let icon = new St.Icon({ style_class: 'nm-dialog-header-icon', - icon_name: 'network-wireless-signal-excellent-symbolic' }); + const icon = new St.Icon({ + style_class: 'nm-dialog-header-icon', + icon_name: 'network-wireless-signal-excellent-symbolic', + }); let titleBox = new St.BoxLayout({ vertical: true }); - let title = new St.Label({ style_class: 'nm-dialog-header', - text: _("Wi-Fi Networks") }); - let subtitle = new St.Label({ style_class: 'nm-dialog-subheader', - text: _("Select a network") }); + const title = new St.Label({ + style_class: 'nm-dialog-header', + text: _('Wi-Fi Networks'), + }); + const subtitle = new St.Label({ + style_class: 'nm-dialog-subheader', + text: _('Select a network'), + }); titleBox.add(title); titleBox.add(subtitle); @@ -944,21 +954,27 @@ class NMWirelessDialog extends ModalDialog.ModalDialog { this._scrollView.add_actor(this._itemBox); this._stack.add_child(this._scrollView); - this._noNetworksBox = new St.BoxLayout({ vertical: true, - style_class: 'no-networks-box', - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER }); + this._noNetworksBox = new St.BoxLayout({ + vertical: true, + style_class: 'no-networks-box', + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + }); this._noNetworksSpinner = new Animation.Spinner(16); this._noNetworksBox.add_actor(this._noNetworksSpinner); - this._noNetworksBox.add_actor(new St.Label({ style_class: 'no-networks-label', - text: _("No Networks") })); + this._noNetworksBox.add_actor(new St.Label({ + style_class: 'no-networks-label', + text: _('No Networks'), + })); this._stack.add_child(this._noNetworksBox); - this._airplaneBox = new St.BoxLayout({ vertical: true, - style_class: 'nm-dialog-airplane-box', - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER }); + this._airplaneBox = new St.BoxLayout({ + vertical: true, + style_class: 'nm-dialog-airplane-box', + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + }); this._airplaneIcon = new St.Icon({ icon_size: 48 }); this._airplaneHeadline = new St.Label({ style_class: 'nm-dialog-airplane-headline headline' }); this._airplaneText = new St.Label({ style_class: 'nm-dialog-airplane-text' }); @@ -972,8 +988,10 @@ class NMWirelessDialog extends ModalDialog.ModalDialog { this._client.wireless_enabled = true; }); airplaneSubStack.add_actor(this._airplaneButton); - this._airplaneInactive = new St.Label({ style_class: 'nm-dialog-airplane-text', - text: _("Use hardware switch to turn off") }); + this._airplaneInactive = new St.Label({ + style_class: 'nm-dialog-airplane-text', + text: _('Use hardware switch to turn off'), + }); airplaneSubStack.add_actor(this._airplaneInactive); this._airplaneBox.add_child(this._airplaneIcon); @@ -984,12 +1002,16 @@ class NMWirelessDialog extends ModalDialog.ModalDialog { this.contentLayout.add_child(this._stack); - this._disconnectButton = this.addButton({ action: () => this.close(), - label: _("Cancel"), - key: Clutter.KEY_Escape }); - this._connectButton = this.addButton({ action: this._connect.bind(this), - label: _("Connect"), - key: Clutter.KEY_Return }); + this._disconnectButton = this.addButton({ + action: () => this.close(), + label: _('Cancel'), + key: Clutter.KEY_Escape, + }); + this._connectButton = this.addButton({ + action: this._connect.bind(this), + label: _('Connect'), + key: Clutter.KEY_Return, + }); } _connect() { diff --git a/js/ui/switchMonitor.js b/js/ui/switchMonitor.js index 2d9b0dead..733858218 100644 --- a/js/ui/switchMonitor.js +++ b/js/ui/switchMonitor.js @@ -100,11 +100,15 @@ class SwitchMonitorSwitcher extends SwitcherPopup.SwitcherList { } _addIcon(item) { - let box = new St.BoxLayout({ style_class: 'alt-tab-app', - vertical: true }); + const box = new St.BoxLayout({ + style_class: 'alt-tab-app', + vertical: true, + }); - let icon = new St.Icon({ icon_name: item.icon, - icon_size: APP_ICON_SIZE }); + const icon = new St.Icon({ + icon_name: item.icon, + icon_size: APP_ICON_SIZE, + }); box.add_child(icon); let text = new St.Label({ diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index 17c3fcaa3..a380c861a 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -33,9 +33,11 @@ var SwitcherPopup = GObject.registerClass({ GTypeFlags: GObject.TypeFlags.ABSTRACT, }, class SwitcherPopup extends St.Widget { _init(items) { - super._init({ style_class: 'switcher-popup', - reactive: true, - visible: false }); + super._init({ + style_class: 'switcher-popup', + reactive: true, + visible: false, + }); this._switcherList = null; @@ -359,8 +361,10 @@ var SwitcherPopup = GObject.registerClass({ var SwitcherButton = GObject.registerClass( class SwitcherButton extends St.Button { _init(square) { - super._init({ style_class: 'item-box', - reactive: true }); + super._init({ + style_class: 'item-box', + reactive: true, + }); this._square = square; } @@ -374,17 +378,21 @@ class SwitcherButton extends St.Button { }); var SwitcherList = GObject.registerClass({ - Signals: { 'item-activated': { param_types: [GObject.TYPE_INT] }, - 'item-entered': { param_types: [GObject.TYPE_INT] }, - 'item-removed': { param_types: [GObject.TYPE_INT] } }, + Signals: { + 'item-activated': { param_types: [GObject.TYPE_INT] }, + 'item-entered': { param_types: [GObject.TYPE_INT] }, + 'item-removed': { param_types: [GObject.TYPE_INT] }, + }, }, class SwitcherList extends St.Widget { _init(squareItems) { super._init({ style_class: 'switcher-list' }); - this._list = new St.BoxLayout({ style_class: 'switcher-list-item-container', - vertical: false, - x_expand: true, - y_expand: true }); + this._list = new St.BoxLayout({ + style_class: 'switcher-list-item-container', + vertical: false, + x_expand: true, + y_expand: true, + }); let layoutManager = this._list.get_layout_manager(); @@ -393,21 +401,27 @@ var SwitcherList = GObject.registerClass({ this._list.spacing = this._list.get_theme_node().get_length('spacing'); }); - this._scrollView = new St.ScrollView({ style_class: 'hfade', - enable_mouse_scrolling: false }); + this._scrollView = new St.ScrollView({ + style_class: 'hfade', + enable_mouse_scrolling: false, + }); this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.NEVER); this._scrollView.add_actor(this._list); this.add_actor(this._scrollView); // Those arrows indicate whether scrolling in one direction is possible - this._leftArrow = new St.DrawingArea({ style_class: 'switcher-arrow', - pseudo_class: 'highlighted' }); + this._leftArrow = new St.DrawingArea({ + style_class: 'switcher-arrow', + pseudo_class: 'highlighted', + }); this._leftArrow.connect('repaint', () => { drawArrow(this._leftArrow, St.Side.LEFT); }); - this._rightArrow = new St.DrawingArea({ style_class: 'switcher-arrow', - pseudo_class: 'highlighted' }); + this._rightArrow = new St.DrawingArea({ + style_class: 'switcher-arrow', + pseudo_class: 'highlighted', + }); this._rightArrow.connect('repaint', () => { drawArrow(this._rightArrow, St.Side.RIGHT); }); diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 990b1c02f..61e277540 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -1,8 +1,10 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported UnlockDialog */ -const { AccountsService, Atk, Clutter, Gdm, Gio, - GnomeDesktop, GLib, GObject, Meta, Shell, St } = imports.gi; +const { + AccountsService, Atk, Clutter, Gdm, Gio, + GnomeDesktop, GLib, GObject, Meta, Shell, St, +} = imports.gi; const Background = imports.ui.background; const Layout = imports.ui.layout; diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js index c376028af..aa1de1254 100644 --- a/js/ui/userWidget.js +++ b/js/ui/userWidget.js @@ -111,12 +111,16 @@ class UserWidgetLabel extends St.Widget { this._user = user; - this._realNameLabel = new St.Label({ style_class: 'user-widget-label', - y_align: Clutter.ActorAlign.CENTER }); + this._realNameLabel = new St.Label({ + style_class: 'user-widget-label', + y_align: Clutter.ActorAlign.CENTER, + }); this.add_child(this._realNameLabel); - this._userNameLabel = new St.Label({ style_class: 'user-widget-label', - y_align: Clutter.ActorAlign.CENTER }); + this._userNameLabel = new St.Label({ + style_class: 'user-widget-label', + y_align: Clutter.ActorAlign.CENTER, + }); this.add_child(this._userNameLabel); this._currentLabel = null; diff --git a/js/ui/welcomeDialog.js b/js/ui/welcomeDialog.js index fd38fd262..63c6d9061 100644 --- a/js/ui/welcomeDialog.js +++ b/js/ui/welcomeDialog.js @@ -42,13 +42,15 @@ class WelcomeDialog extends ModalDialog.ModalDialog { this.contentLayout.add_child(content); - this.addButton({ label: _('No Thanks'), - action: () => { - this._sendResponse(DialogResponse.NO_THANKS); - }, - key: Clutter.KEY_Escape }); - this.addButton({ label: _('Take Tour'), - action: () => this._sendResponse(DialogResponse.TAKE_TOUR) }); + this.addButton({ + label: _('No Thanks'), + action: () => this._sendResponse(DialogResponse.NO_THANKS), + key: Clutter.KEY_Escape, + }); + this.addButton({ + label: _('Take Tour'), + action: () => this._sendResponse(DialogResponse.TAKE_TOUR), + }); } _sendResponse(response) { diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 0f5608230..de8e4cec1 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -68,12 +68,16 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog { /* Translators: this and the following message should be limited in length, to avoid ellipsizing the labels. */ - this._cancelButton = this.addButton({ label: _("Revert Settings"), - action: this._onFailure.bind(this), - key: Clutter.KEY_Escape }); - this._okButton = this.addButton({ label: _("Keep Changes"), - action: this._onSuccess.bind(this), - default: true }); + this._cancelButton = this.addButton({ + label: _('Revert Settings'), + action: this._onFailure.bind(this), + key: Clutter.KEY_Escape, + }); + this._okButton = this.addButton({ + label: _('Keep Changes'), + action: this._onSuccess.bind(this), + default: true, + }); this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, ONE_SECOND, this._tick.bind(this)); GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._tick'); @@ -413,10 +417,12 @@ class TilePreview extends St.Widget { this._updateStyle(monitor); if (!this._showing || changeMonitor) { - let monitorRect = new Meta.Rectangle({ x: monitor.x, - y: monitor.y, - width: monitor.width, - height: monitor.height }); + const monitorRect = new Meta.Rectangle({ + x: monitor.x, + y: monitor.y, + width: monitor.width, + height: monitor.height, + }); let [, rect] = window.get_frame_rect().intersect(monitorRect); this.set_size(rect.width, rect.height); this.set_position(rect.x, rect.y); @@ -533,10 +539,13 @@ var ResizePopup = GObject.registerClass( class ResizePopup extends St.Widget { _init() { super._init({ layout_manager: new Clutter.BinLayout() }); - this._label = new St.Label({ style_class: 'resize-popup', - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER, - x_expand: true, y_expand: true }); + this._label = new St.Label({ + style_class: 'resize-popup', + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + x_expand: true, + y_expand: true, + }); this.add_child(this._label); Main.uiGroup.add_actor(this); } diff --git a/js/ui/windowPreview.js b/js/ui/windowPreview.js index e67ec9ec0..16bda2a7f 100644 --- a/js/ui/windowPreview.js +++ b/js/ui/windowPreview.js @@ -1,8 +1,9 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported WindowPreview */ -const { Atk, Clutter, GLib, GObject, - Graphene, Meta, Pango, Shell, St } = imports.gi; +const { + Atk, Clutter, GLib, GObject, Graphene, Meta, Pango, Shell, St, +} = imports.gi; const DND = imports.ui.dnd; const OverviewControls = imports.ui.overviewControls; @@ -104,11 +105,12 @@ var WindowPreview = GObject.registerClass({ this.add_action(clickAction); this.connect('destroy', this._onDestroy.bind(this)); - this._draggable = DND.makeDraggable(this, - { restoreOnSuccess: true, - manualMode: true, - dragActorMaxSize: WINDOW_DND_SIZE, - dragActorOpacity: DRAGGING_WINDOW_OPACITY }); + this._draggable = DND.makeDraggable(this, { + restoreOnSuccess: true, + manualMode: true, + dragActorMaxSize: WINDOW_DND_SIZE, + dragActorOpacity: DRAGGING_WINDOW_OPACITY, + }); this._draggable.connect('drag-begin', this._onDragBegin.bind(this)); this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this)); this._draggable.connect('drag-end', this._onDragEnd.bind(this)); diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 1ad403f9f..bba56f926 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -152,10 +152,12 @@ var UnalignedLayoutStrategy = class extends LayoutStrategy { // meant to be scaled // // * neither height/fullHeight have any sort of spacing or padding - return { x: 0, y: 0, - width: 0, height: 0, - fullWidth: 0, fullHeight: 0, - windows: [] }; + return { + x: 0, y: 0, + width: 0, height: 0, + fullWidth: 0, fullHeight: 0, + windows: [], + }; } // Computes and returns an individual scaling factor for @window, @@ -1499,8 +1501,10 @@ class Workspace extends St.Widget { } else if (!source.app && source.shellWorkspaceLaunch) { // While unused in our own drag sources, shellWorkspaceLaunch allows // extensions to define custom actions for their drag sources. - source.shellWorkspaceLaunch({ workspace: workspaceIndex, - timestamp: time }); + source.shellWorkspaceLaunch({ + workspace: workspaceIndex, + timestamp: time, + }); return true; } diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 412527c93..69fc7c5bd 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -76,10 +76,11 @@ var WindowClone = GObject.registerClass({ this.connect('destroy', this._onDestroy.bind(this)); - this._draggable = DND.makeDraggable(this, - { restoreOnSuccess: true, - dragActorMaxSize: Workspace.WINDOW_DND_SIZE, - dragActorOpacity: Workspace.DRAGGING_WINDOW_OPACITY }); + this._draggable = DND.makeDraggable(this, { + restoreOnSuccess: true, + dragActorMaxSize: Workspace.WINDOW_DND_SIZE, + dragActorOpacity: Workspace.DRAGGING_WINDOW_OPACITY, + }); this._draggable.connect('drag-begin', this._onDragBegin.bind(this)); this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this)); this._draggable.connect('drag-end', this._onDragEnd.bind(this)); @@ -593,8 +594,10 @@ var WorkspaceThumbnail = GObject.registerClass({ } else if (!source.app && source.shellWorkspaceLaunch) { // While unused in our own drag sources, shellWorkspaceLaunch allows // extensions to define custom actions for their drag sources. - source.shellWorkspaceLaunch({ workspace: this.metaWorkspace.index(), - timestamp: time }); + source.shellWorkspaceLaunch({ + workspace: this.metaWorkspace.index(), + timestamp: time, + }); return true; } @@ -964,8 +967,10 @@ var ThumbnailsBox = GObject.registerClass({ } else if (!source.app && source.shellWorkspaceLaunch) { // While unused in our own drag sources, shellWorkspaceLaunch allows // extensions to define custom actions for their drag sources. - source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex, - timestamp: time }); + source.shellWorkspaceLaunch({ + workspace: newWorkspaceIndex, + timestamp: time, + }); } if (source.app || (!source.app && source.shellWorkspaceLaunch)) { diff --git a/js/ui/xdndHandler.js b/js/ui/xdndHandler.js index 95549f3db..0ea81a397 100644 --- a/js/ui/xdndHandler.js +++ b/js/ui/xdndHandler.js @@ -59,8 +59,10 @@ var XdndHandler = class { if (!cursorWindow.get_meta_window().is_override_redirect()) return; - let constraintPosition = new Clutter.BindConstraint({ coordinate: Clutter.BindCoordinate.POSITION, - source: cursorWindow }); + const constraintPosition = new Clutter.BindConstraint({ + coordinate: Clutter.BindCoordinate.POSITION, + source: cursorWindow, + }); this._cursorWindowClone = new Clutter.Clone({ source: cursorWindow }); Main.uiGroup.add_actor(this._cursorWindowClone); diff --git a/lint/eslintrc-legacy.yml b/lint/eslintrc-legacy.yml index 127166ef2..9e5e6dcef 100644 --- a/lint/eslintrc-legacy.yml +++ b/lint/eslintrc-legacy.yml @@ -7,8 +7,6 @@ rules: - 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child' CallExpression: arguments: first - ObjectExpression: first - MemberExpression: off jsdoc/check-alignment: off jsdoc/check-param-names: off jsdoc/check-tag-names: off @@ -20,7 +18,4 @@ rules: jsdoc/require-param-description: off jsdoc/require-param-name: off jsdoc/require-param-type: off - object-curly-newline: - - error - - consistent: true quotes: off