cleanup: Remove spaces in object literals

We only adopted this style relatively recently, so there's a bit
more to adjust. Still, it's manageable and another step towards
getting rid of the legacy style.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
This commit is contained in:
Florian Müllner 2023-08-07 00:40:20 +02:00 committed by Marge Bot
parent 6a22af83dc
commit 071f92cfb6
93 changed files with 583 additions and 586 deletions

View File

@ -136,7 +136,7 @@ export class ServiceImplementation {
} }
_injectTracking(methodName) { _injectTracking(methodName) {
const { prototype } = Gio.DBusMethodInvocation; const {prototype} = Gio.DBusMethodInvocation;
const origMethod = prototype[methodName]; const origMethod = prototype[methodName];
const that = this; const that = this;

View File

@ -24,7 +24,7 @@ import St from 'gi://St';
const SCROLL_ANIMATION_TIME = 500; const SCROLL_ANIMATION_TIME = 500;
const AuthListItem = GObject.registerClass({ const AuthListItem = GObject.registerClass({
Signals: { 'activate': {} }, Signals: {'activate': {}},
}, class AuthListItem extends St.Button { }, class AuthListItem extends St.Button {
_init(key, text) { _init(key, text) {
this.key = key; this.key = key;
@ -69,8 +69,8 @@ const AuthListItem = GObject.registerClass({
export const AuthList = GObject.registerClass({ export const AuthList = GObject.registerClass({
Signals: { Signals: {
'activate': { param_types: [GObject.TYPE_STRING] }, 'activate': {param_types: [GObject.TYPE_STRING]},
'item-added': { param_types: [AuthListItem.$gtype] }, 'item-added': {param_types: [AuthListItem.$gtype]},
}, },
}, class AuthList extends St.BoxLayout { }, class AuthList extends St.BoxLayout {
_init() { _init() {
@ -81,7 +81,7 @@ export const AuthList = GObject.registerClass({
y_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER,
}); });
this.label = new St.Label({ style_class: 'login-dialog-auth-list-title' }); this.label = new St.Label({style_class: 'login-dialog-auth-list-title'});
this.add_child(this.label); this.add_child(this.label);
this._scrollView = new St.ScrollView({ this._scrollView = new St.ScrollView({

View File

@ -51,7 +51,7 @@ export const AuthPrompt = GObject.registerClass({
'failed': {}, 'failed': {},
'next': {}, 'next': {},
'prompted': {}, 'prompted': {},
'reset': { param_types: [GObject.TYPE_UINT] }, 'reset': {param_types: [GObject.TYPE_UINT]},
}, },
}, class AuthPrompt extends St.BoxLayout { }, class AuthPrompt extends St.BoxLayout {
_init(gdmClient, mode) { _init(gdmClient, mode) {
@ -76,7 +76,7 @@ export const AuthPrompt = GObject.registerClass({
else if (this._mode == AuthPromptMode.UNLOCK_OR_LOG_IN) else if (this._mode == AuthPromptMode.UNLOCK_OR_LOG_IN)
reauthenticationOnly = false; reauthenticationOnly = false;
this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly }); this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, {reauthenticationOnly});
this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this)); this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
this._userVerifier.connect('show-message', this._onShowMessage.bind(this)); this._userVerifier.connect('show-message', this._onShowMessage.bind(this));

View File

@ -45,7 +45,7 @@ const _SCROLL_ANIMATION_TIME = 500;
const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0; const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0;
export const UserListItem = GObject.registerClass({ export const UserListItem = GObject.registerClass({
Signals: { 'activate': {} }, Signals: {'activate': {}},
}, class UserListItem extends St.Button { }, class UserListItem extends St.Button {
_init(user) { _init(user) {
let layout = new St.BoxLayout({ let layout = new St.BoxLayout({
@ -158,8 +158,8 @@ export const UserListItem = GObject.registerClass({
const UserList = GObject.registerClass({ const UserList = GObject.registerClass({
Signals: { Signals: {
'activate': { param_types: [UserListItem.$gtype] }, 'activate': {param_types: [UserListItem.$gtype]},
'item-added': { param_types: [UserListItem.$gtype] }, 'item-added': {param_types: [UserListItem.$gtype]},
}, },
}, class UserList extends St.ScrollView { }, class UserList extends St.ScrollView {
_init() { _init() {
@ -312,7 +312,7 @@ const UserList = GObject.registerClass({
}); });
const SessionMenuButton = GObject.registerClass({ const SessionMenuButton = GObject.registerClass({
Signals: { 'session-activated': { param_types: [GObject.TYPE_STRING] } }, Signals: {'session-activated': {param_types: [GObject.TYPE_STRING]}},
}, class SessionMenuButton extends St.Bin { }, class SessionMenuButton extends St.Bin {
_init() { _init() {
let button = new St.Button({ let button = new St.Button({
@ -327,7 +327,7 @@ const SessionMenuButton = GObject.registerClass({
y_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER,
}); });
super._init({ child: button }); super._init({child: button});
this._button = button; this._button = button;
this._menu = new PopupMenu.PopupMenu(this._button, 0, St.Side.BOTTOM); this._menu = new PopupMenu.PopupMenu(this._button, 0, St.Side.BOTTOM);
@ -342,7 +342,7 @@ const SessionMenuButton = GObject.registerClass({
}); });
this._manager = new PopupMenu.PopupMenuManager(this._button, this._manager = new PopupMenu.PopupMenuManager(this._button,
{ actionMode: Shell.ActionMode.NONE }); {actionMode: Shell.ActionMode.NONE});
this._manager.addMenu(this._menu); this._manager.addMenu(this._menu);
this._button.connect('clicked', () => this._menu.toggle()); this._button.connect('clicked', () => this._menu.toggle());
@ -413,11 +413,11 @@ export const LoginDialog = GObject.registerClass({
}, },
}, class LoginDialog extends St.Widget { }, class LoginDialog extends St.Widget {
_init(parentActor) { _init(parentActor) {
super._init({ style_class: 'login-dialog', visible: false }); super._init({style_class: 'login-dialog', visible: false});
this.get_accessible().set_role(Atk.Role.WINDOW); this.get_accessible().set_role(Atk.Role.WINDOW);
this.add_constraint(new Layout.MonitorConstraint({ primary: true })); this.add_constraint(new Layout.MonitorConstraint({primary: true}));
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));
parentActor.add_child(this); parentActor.add_child(this);
@ -429,7 +429,7 @@ export const LoginDialog = GObject.registerClass({
} catch (e) { } catch (e) {
} }
this._settings = new Gio.Settings({ schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA }); this._settings = new Gio.Settings({schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA});
this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_KEY}`, this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_KEY}`,
this._updateBanner.bind(this)); this._updateBanner.bind(this));
@ -493,7 +493,7 @@ export const LoginDialog = GObject.registerClass({
}); });
this.add_child(this._bannerView); this.add_child(this._bannerView);
let bannerBox = new St.BoxLayout({ vertical: true }); let bannerBox = new St.BoxLayout({vertical: true});
this._bannerView.add_actor(bannerBox); this._bannerView.add_actor(bannerBox);
this._bannerLabel = new St.Label({ this._bannerLabel = new St.Label({
@ -885,7 +885,7 @@ export const LoginDialog = GObject.registerClass({
if (previousUser && beginRequest === AuthPrompt.BeginRequestType.REUSE_USERNAME) { if (previousUser && beginRequest === AuthPrompt.BeginRequestType.REUSE_USERNAME) {
this._user = previousUser; this._user = previousUser;
this._authPrompt.setUser(this._user); this._authPrompt.setUser(this._user);
this._authPrompt.begin({ userName: previousUser.get_user_name() }); this._authPrompt.begin({userName: previousUser.get_user_name()});
} else if (beginRequest === AuthPrompt.BeginRequestType.PROVIDE_USERNAME) { } else if (beginRequest === AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
if (!this._disableUserList) if (!this._disableUserList)
this._showUserList(); this._showUserList();
@ -953,7 +953,7 @@ export const LoginDialog = GObject.registerClass({
let answer = this._authPrompt.getAnswer(); let answer = this._authPrompt.getAnswer();
this._user = this._userManager.get_user(answer); this._user = this._userManager.get_user(answer);
this._authPrompt.clear(); this._authPrompt.clear();
this._authPrompt.begin({ userName: answer }); this._authPrompt.begin({userName: answer});
this._updateCancelButton(); this._updateCancelButton();
}); });
this._updateCancelButton(); this._updateCancelButton();
@ -1195,7 +1195,7 @@ export const LoginDialog = GObject.registerClass({
let userName = item.user.get_user_name(); let userName = item.user.get_user_name();
let hold = new Batch.Hold(); let hold = new Batch.Hold();
this._authPrompt.begin({ userName, hold }); this._authPrompt.begin({userName, hold});
return hold; return hold;
} }
@ -1264,12 +1264,12 @@ export const LoginDialog = GObject.registerClass({
Main.ctrlAltTabManager.addGroup(this, Main.ctrlAltTabManager.addGroup(this,
_('Login Window'), _('Login Window'),
'dialog-password-symbolic', 'dialog-password-symbolic',
{ sortGroup: CtrlAltTab.SortGroup.MIDDLE }); {sortGroup: CtrlAltTab.SortGroup.MIDDLE});
this.activate(); this.activate();
this.opacity = 0; this.opacity = 0;
this._grab = Main.pushModal(global.stage, { actionMode: Shell.ActionMode.LOGIN_SCREEN }); this._grab = Main.pushModal(global.stage, {actionMode: Shell.ActionMode.LOGIN_SCREEN});
this.ease({ this.ease({
opacity: 255, opacity: 255,

View File

@ -99,7 +99,7 @@ export function cloneAndFadeOutActor(actor) {
export class ShellUserVerifier extends Signals.EventEmitter { export class ShellUserVerifier extends Signals.EventEmitter {
constructor(client, params) { constructor(client, params) {
super(); super();
params = Params.parse(params, { reauthenticationOnly: false }); params = Params.parse(params, {reauthenticationOnly: false});
this._reauthOnly = params.reauthenticationOnly; this._reauthOnly = params.reauthenticationOnly;
this._client = client; this._client = client;
@ -107,7 +107,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
this._defaultService = null; this._defaultService = null;
this._preemptingService = null; this._preemptingService = null;
this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA }); this._settings = new Gio.Settings({schema_id: LOGIN_SCREEN_SCHEMA});
this._settings.connect('changed', this._settings.connect('changed',
this._updateDefaultService.bind(this)); this._updateDefaultService.bind(this));
this._updateDefaultService(); this._updateDefaultService();
@ -316,7 +316,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
_queueMessage(serviceName, message, messageType) { _queueMessage(serviceName, message, messageType) {
let interval = this._getIntervalForMessage(message); let interval = this._getIntervalForMessage(message);
this._messageQueue.push({ serviceName, text: message, type: messageType, interval }); this._messageQueue.push({serviceName, text: message, type: messageType, interval});
this._queueMessageTimeout(); this._queueMessageTimeout();
} }

View File

@ -221,7 +221,7 @@ class IBusManager extends Signals.EventEmitter {
this._candidatePopup.setPanelService(this._panelService); this._candidatePopup.setPanelService(this._panelService);
this._panelService.connect('update-property', this._updateProperty.bind(this)); this._panelService.connect('update-property', this._updateProperty.bind(this));
this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => { this._panelService.connect('set-cursor-location', (ps, x, y, w, h) => {
let cursorLocation = { x, y, width: w, height: h }; let cursorLocation = {x, y, width: w, height: h};
this.emit('set-cursor-location', cursorLocation); this.emit('set-cursor-location', cursorLocation);
}); });
this._panelService.connect('focus-in', (panel, path) => { this._panelService.connect('focus-in', (panel, path) => {

View File

@ -103,7 +103,7 @@ export function findMatchingSlash(expr, offset) {
*/ */
export function findMatchingBrace(expr, offset) { export function findMatchingBrace(expr, offset) {
let closeBrace = expr.charAt(offset); let closeBrace = expr.charAt(offset);
let openBrace = { ')': '(', ']': '[' }[closeBrace]; let openBrace = {')': '(', ']': '['}[closeBrace];
return findTheBrace(expr, offset - 1, openBrace, closeBrace); return findTheBrace(expr, offset - 1, openBrace, closeBrace);
} }

View File

@ -67,7 +67,7 @@ class KeyboardManager {
this._currentKeymap.options == options) this._currentKeymap.options == options)
return; return;
this._currentKeymap = { layouts, variants, options }; this._currentKeymap = {layouts, variants, options};
global.backend.set_keymap(layouts, variants, options); global.backend.set_keymap(layouts, variants, options);
} }
@ -106,7 +106,7 @@ class KeyboardManager {
for (let i = 0; i < ids.length; ++i) { for (let i = 0; i < ids.length; ++i) {
let [found, , , _layout, _variant] = this._xkbInfo.get_layout_info(ids[i]); let [found, , , _layout, _variant] = this._xkbInfo.get_layout_info(ids[i]);
if (found) if (found)
this._layoutInfos[ids[i]] = { id: ids[i], layout: _layout, variant: _variant }; this._layoutInfos[ids[i]] = {id: ids[i], layout: _layout, variant: _variant};
} }
let i = 0; let i = 0;
@ -142,9 +142,9 @@ class KeyboardManager {
let _layout, _variant; let _layout, _variant;
[found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id); [found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id);
if (found) if (found)
return { layout: _layout, variant: _variant }; return {layout: _layout, variant: _variant};
else else
return { layout: DEFAULT_LAYOUT, variant: DEFAULT_VARIANT }; return {layout: DEFAULT_LAYOUT, variant: DEFAULT_VARIANT};
} }
_buildGroupStrings(_group) { _buildGroupStrings(_group) {

View File

@ -199,7 +199,7 @@ class LoginManagerSystemd extends Signals.EventEmitter {
await this._proxy.call_with_unix_fd_list('Inhibit', await this._proxy.call_with_unix_fd_list('Inhibit',
inVariant, 0, -1, null, cancellable); inVariant, 0, -1, null, cancellable);
const [fd] = fdList.steal_fds(); const [fd] = fdList.steal_fds();
return new Gio.UnixInputStream({ fd }); return new Gio.UnixInputStream({fd});
} }
_prepareForSleep(proxy, sender, [aboutToSuspend]) { _prepareForSleep(proxy, sender, [aboutToSuspend]) {

View File

@ -243,7 +243,7 @@ export const BroadbandModem = GObject.registerClass({
}, },
}, class BroadbandModem extends ModemBase { }, class BroadbandModem extends ModemBase {
_init(path, capabilities) { _init(path, capabilities) {
super._init({ capabilities }); super._init({capabilities});
this._proxy = new BroadbandModemProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path); this._proxy = new BroadbandModemProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
this._proxy_3gpp = new BroadbandModem3gppProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path); this._proxy_3gpp = new BroadbandModem3gppProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);
this._proxy_cdma = new BroadbandModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path); this._proxy_cdma = new BroadbandModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager1', path);

View File

@ -76,7 +76,7 @@ const ParentalControlsManager = GObject.registerClass({
try { try {
const connection = await Gio.DBus.get(Gio.BusType.SYSTEM, null); const connection = await Gio.DBus.get(Gio.BusType.SYSTEM, null);
this._manager = new Malcontent.Manager({ connection }); this._manager = new Malcontent.Manager({connection});
this._appFilter = await this._getAppFilter(); this._appFilter = await this._getAppFilter();
} catch (e) { } catch (e) {
logError(e, 'Failed to get parental controls settings'); logError(e, 'Failed to get parental controls settings');

View File

@ -106,7 +106,7 @@ class SignalTracker {
_getSignalData(obj) { _getSignalData(obj) {
let data = this._map.get(obj); let data = this._map.get(obj);
if (data === undefined) { if (data === undefined) {
data = { ownerSignals: [], destroyId: 0 }; data = {ownerSignals: [], destroyId: 0};
this._map.set(obj, data); this._map.set(obj, data);
} }
return data; return data;
@ -164,7 +164,7 @@ class SignalTracker {
* @returns {void} * @returns {void}
*/ */
untrack(obj) { untrack(obj) {
const { ownerSignals, destroyId } = this._getSignalData(obj); const {ownerSignals, destroyId} = this._getSignalData(obj);
this._map.delete(obj); this._map.delete(obj);
const ownerProto = this._getObjectProto(this._owner); const ownerProto = this._getObjectProto(this._owner);

View File

@ -284,7 +284,7 @@ const SystemActions = GObject.registerClass({
let results = []; let results = [];
for (let [key, { available, keywords }] of this._actions) { for (let [key, {available, keywords}] of this._actions) {
if (available && terms.every(t => keywords.some(k => k.startsWith(t)))) if (available && terms.every(t => keywords.some(k => k.startsWith(t))))
results.push(key); results.push(key);
} }

View File

@ -52,7 +52,7 @@ let _desktopSettings = null;
export function findUrls(str) { export function findUrls(str) {
let res = [], match; let res = [], match;
while ((match = _urlRegexp.exec(str))) while ((match = _urlRegexp.exec(str)))
res.push({ url: match[2], pos: match.index + match[1].length }); res.push({url: match[2], pos: match.index + match[1].length});
return res; return res;
} }
@ -143,7 +143,7 @@ function trySpawn(argv) {
// We are only interested in the part in the parentheses. (And // We are only interested in the part in the parentheses. (And
// we can't pattern match the text, since it gets localized.) // we can't pattern match the text, since it gets localized.)
let message = err.message.replace(/.*\((.+)\)/, '$1'); let message = err.message.replace(/.*\((.+)\)/, '$1');
throw new err.constructor({ code: err.code, message }); throw new err.constructor({code: err.code, message});
} else { } else {
throw err; throw err;
} }
@ -196,9 +196,9 @@ function _handleSpawnError(command, err) {
*/ */
export function createTimeLabel(date, params) { export function createTimeLabel(date, params) {
if (_desktopSettings == null) if (_desktopSettings == null)
_desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' }); _desktopSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'});
let label = new St.Label({ text: formatTime(date, params) }); let label = new St.Label({text: formatTime(date, params)});
_desktopSettings.connectObject( _desktopSettings.connectObject(
'changed::clock-format', () => (label.text = formatTime(date, params)), 'changed::clock-format', () => (label.text = formatTime(date, params)),
label); label);

View File

@ -69,7 +69,7 @@ export class WeatherClient extends Signals.EventEmitter {
this._permStore.connectSignal('Changed', this._permStore.connectSignal('Changed',
this._onPermStoreChanged.bind(this)); this._onPermStoreChanged.bind(this));
this._locationSettings = new Gio.Settings({ schema_id: 'org.gnome.system.location' }); this._locationSettings = new Gio.Settings({schema_id: 'org.gnome.system.location'});
this._locationSettings.connect('changed::enabled', this._locationSettings.connect('changed::enabled',
this._updateAutoLocation.bind(this)); this._updateAutoLocation.bind(this));

View File

@ -25,7 +25,7 @@ const DialogResponse = {
const AccessDialog = GObject.registerClass( const AccessDialog = GObject.registerClass(
class AccessDialog extends ModalDialog.ModalDialog { class AccessDialog extends ModalDialog.ModalDialog {
_init(invocation, handle, title, description, body, options) { _init(invocation, handle, title, description, body, options) {
super._init({ styleClass: 'access-dialog' }); super._init({styleClass: 'access-dialog'});
this._invocation = invocation; this._invocation = invocation;
this._handle = handle; this._handle = handle;
@ -46,7 +46,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
let grantLabel = options['grant_label'] || _('Allow'); let grantLabel = options['grant_label'] || _('Allow');
let choices = options['choices'] || []; let choices = options['choices'] || [];
let content = new Dialog.MessageDialogContent({ title, description }); let content = new Dialog.MessageDialogContent({title, description});
this.contentLayout.add_actor(content); this.contentLayout.add_actor(content);
this._choices = new Map(); this._choices = new Map();

View File

@ -408,17 +408,17 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
const CyclerHighlight = GObject.registerClass( const CyclerHighlight = GObject.registerClass(
class CyclerHighlight extends St.Widget { class CyclerHighlight extends St.Widget {
_init() { _init() {
super._init({ layout_manager: new Clutter.BinLayout() }); super._init({layout_manager: new Clutter.BinLayout()});
this._window = null; this._window = null;
this._clone = new Clutter.Clone(); this._clone = new Clutter.Clone();
this.add_actor(this._clone); this.add_actor(this._clone);
this._highlight = new St.Widget({ style_class: 'cycler-highlight' }); this._highlight = new St.Widget({style_class: 'cycler-highlight'});
this.add_actor(this._highlight); this.add_actor(this._highlight);
let coordinate = Clutter.BindCoordinate.ALL; let coordinate = Clutter.BindCoordinate.ALL;
let constraint = new Clutter.BindConstraint({ coordinate }); let constraint = new Clutter.BindConstraint({coordinate});
this._clone.bind_property('source', constraint, 'source', 0); this._clone.bind_property('source', constraint, 'source', 0);
this.add_constraint(constraint); this.add_constraint(constraint);
@ -473,10 +473,10 @@ class CyclerHighlight extends St.Widget {
// expects instead of inheriting from SwitcherList // expects instead of inheriting from SwitcherList
const CyclerList = GObject.registerClass({ const CyclerList = GObject.registerClass({
Signals: { Signals: {
'item-activated': { param_types: [GObject.TYPE_INT] }, 'item-activated': {param_types: [GObject.TYPE_INT]},
'item-entered': { param_types: [GObject.TYPE_INT] }, 'item-entered': {param_types: [GObject.TYPE_INT]},
'item-removed': { param_types: [GObject.TYPE_INT] }, 'item-removed': {param_types: [GObject.TYPE_INT]},
'item-highlighted': { param_types: [GObject.TYPE_INT] }, 'item-highlighted': {param_types: [GObject.TYPE_INT]},
}, },
}, class CyclerList extends St.Widget { }, class CyclerList extends St.Widget {
highlight(index, _justOutline) { highlight(index, _justOutline) {
@ -543,7 +543,7 @@ const CyclerPopup = GObject.registerClass({
export const GroupCyclerPopup = GObject.registerClass( export const GroupCyclerPopup = GObject.registerClass(
class GroupCyclerPopup extends CyclerPopup { class GroupCyclerPopup extends CyclerPopup {
_init() { _init() {
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.app-switcher' }); this._settings = new Gio.Settings({schema_id: 'org.gnome.shell.app-switcher'});
super._init(); super._init();
} }
@ -577,7 +577,7 @@ export const WindowSwitcherPopup = GObject.registerClass(
class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup { class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
_init() { _init() {
super._init(); super._init();
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' }); this._settings = new Gio.Settings({schema_id: 'org.gnome.shell.window-switcher'});
let windows = this._getWindowList(); let windows = this._getWindowList();
@ -634,7 +634,7 @@ class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
export const WindowCyclerPopup = GObject.registerClass( export const WindowCyclerPopup = GObject.registerClass(
class WindowCyclerPopup extends CyclerPopup { class WindowCyclerPopup extends CyclerPopup {
_init() { _init() {
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' }); this._settings = new Gio.Settings({schema_id: 'org.gnome.shell.window-switcher'});
super._init(); super._init();
} }
@ -698,7 +698,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
this._arrows = []; this._arrows = [];
let windowTracker = Shell.WindowTracker.get_default(); let windowTracker = Shell.WindowTracker.get_default();
let settings = new Gio.Settings({ schema_id: 'org.gnome.shell.app-switcher' }); let settings = new Gio.Settings({schema_id: 'org.gnome.shell.app-switcher'});
let workspace = null; let workspace = null;
if (settings.get_boolean('current-workspace-only')) { if (settings.get_boolean('current-workspace-only')) {
@ -880,7 +880,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
this._removeIcon(app); this._removeIcon(app);
}, this); }, this);
let arrow = new St.DrawingArea({ style_class: 'switcher-arrow' }); let arrow = new St.DrawingArea({style_class: 'switcher-arrow'});
arrow.connect('repaint', () => SwitcherPopup.drawArrow(arrow, St.Side.BOTTOM)); arrow.connect('repaint', () => SwitcherPopup.drawArrow(arrow, St.Side.BOTTOM));
this.add_actor(arrow); this.add_actor(arrow);
this._arrows.push(arrow); this._arrows.push(arrow);
@ -922,7 +922,7 @@ class ThumbnailSwitcher extends SwitcherPopup.SwitcherList {
vertical: true, vertical: true,
}); });
let bin = new St.Bin({ style_class: 'thumbnail' }); let bin = new St.Bin({style_class: 'thumbnail'});
box.add_actor(bin); box.add_actor(bin);
this._thumbnailBins.push(bin); this._thumbnailBins.push(bin);
@ -1006,10 +1006,10 @@ class WindowIcon extends St.BoxLayout {
this.window = window; this.window = window;
this._icon = new St.Widget({ layout_manager: new Clutter.BinLayout() }); this._icon = new St.Widget({layout_manager: new Clutter.BinLayout()});
this.add_child(this._icon); this.add_child(this._icon);
this.label = new St.Label({ text: window.get_title() }); this.label = new St.Label({text: window.get_title()});
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
this.app = tracker.get_window_app(window); this.app = tracker.get_window_app(window);
@ -1048,7 +1048,7 @@ class WindowIcon extends St.BoxLayout {
_createAppIcon(app, size) { _createAppIcon(app, size) {
let appIcon = app let appIcon = app
? app.create_icon_texture(size) ? app.create_icon_texture(size)
: new St.Icon({ icon_name: 'icon-missing', icon_size: size }); : new St.Icon({icon_name: 'icon-missing', icon_size: size});
appIcon.x_expand = appIcon.y_expand = true; appIcon.x_expand = appIcon.y_expand = true;
appIcon.x_align = appIcon.y_align = Clutter.ActorAlign.END; appIcon.x_align = appIcon.y_align = Clutter.ActorAlign.END;

View File

@ -733,7 +733,7 @@ var BaseAppView = GObject.registerClass({
adjustment.remove_transition('value'); adjustment.remove_transition('value');
const progress = adjustment.value / adjustment.page_size; const progress = adjustment.value / adjustment.page_size;
const points = Array.from({ length: this._grid.nPages }, (v, i) => i); const points = Array.from({length: this._grid.nPages}, (v, i) => i);
const size = tracker.orientation === Clutter.Orientation.VERTICAL const size = tracker.orientation === Clutter.Orientation.VERTICAL
? this._grid.allocation.get_height() : this._grid.allocation.get_width(); ? this._grid.allocation.get_height() : this._grid.allocation.get_width();
@ -794,7 +794,7 @@ var BaseAppView = GObject.registerClass({
if (!success) if (!success)
return; return;
const { source } = dragEvent; const {source} = dragEvent;
const [page, position, dragLocation] = const [page, position, dragLocation] =
this._getDropTarget(x, y, source); this._getDropTarget(x, y, source);
const item = position !== -1 const item = position !== -1
@ -836,7 +836,7 @@ var BaseAppView = GObject.registerClass({
if (!this._delayedMoveData) if (!this._delayedMoveData)
return; return;
const { source, destroyId, timeoutId } = this._delayedMoveData; const {source, destroyId, timeoutId} = this._delayedMoveData;
if (timeoutId > 0) if (timeoutId > 0)
GLib.source_remove(timeoutId); GLib.source_remove(timeoutId);
@ -1032,7 +1032,7 @@ var BaseAppView = GObject.registerClass({
if (dropTarget === this._prevPageIndicator || if (dropTarget === this._prevPageIndicator ||
dropTarget === this._nextPageIndicator) { dropTarget === this._nextPageIndicator) {
const increment = dropTarget === this._prevPageIndicator ? -1 : 1; const increment = dropTarget === this._prevPageIndicator ? -1 : 1;
const { currentPage, nPages } = this._grid; const {currentPage, nPages} = this._grid;
const page = Math.min(currentPage + increment, nPages); const page = Math.min(currentPage + increment, nPages);
const position = page < nPages ? -1 : 0; const position = page < nPages ? -1 : 0;
@ -1040,7 +1040,7 @@ var BaseAppView = GObject.registerClass({
this.goToPage(page); this.goToPage(page);
} else if (this._delayedMoveData) { } else if (this._delayedMoveData) {
// Dropped before the icon was moved // Dropped before the icon was moved
const { page, position } = this._delayedMoveData; const {page, position} = this._delayedMoveData;
this._moveItem(source, page, position); this._moveItem(source, page, position);
this._removeDelayedMove(); this._removeDelayedMove();
@ -1094,7 +1094,7 @@ var BaseAppView = GObject.registerClass({
} }
_getItemPosition(item) { _getItemPosition(item) {
const { itemsPerPage } = this._grid; const {itemsPerPage} = this._grid;
let iconIndex = this._orderedItems.indexOf(item); let iconIndex = this._orderedItems.indexOf(item);
if (iconIndex === -1) if (iconIndex === -1)
@ -1285,7 +1285,7 @@ var BaseAppView = GObject.registerClass({
}); });
const PageManager = GObject.registerClass({ const PageManager = GObject.registerClass({
Signals: { 'layout-changed': {} }, Signals: {'layout-changed': {}},
}, class PageManager extends GObject.Object { }, class PageManager extends GObject.Object {
_init() { _init() {
super._init(); super._init();
@ -1376,7 +1376,7 @@ class AppDisplay extends BaseAppView {
Shell.AppSystem.get_default().connect('installed-changed', () => { Shell.AppSystem.get_default().connect('installed-changed', () => {
Main.queueDeferredWork(this._redisplayWorkId); Main.queueDeferredWork(this._redisplayWorkId);
}); });
this._folderSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' }); this._folderSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.app-folders'});
this._ensureDefaultFolders(); this._ensureDefaultFolders();
this._folderSettings.connect('changed::folder-children', () => { this._folderSettings.connect('changed::folder-children', () => {
Main.queueDeferredWork(this._redisplayWorkId); Main.queueDeferredWork(this._redisplayWorkId);
@ -1441,9 +1441,9 @@ class AppDisplay extends BaseAppView {
const folders = Object.keys(DEFAULT_FOLDERS); const folders = Object.keys(DEFAULT_FOLDERS);
this._folderSettings.set_strv('folder-children', folders); this._folderSettings.set_strv('folder-children', folders);
const { path } = this._folderSettings; const {path} = this._folderSettings;
for (const folder of folders) { for (const folder of folders) {
const { name, categories, apps } = DEFAULT_FOLDERS[folder]; const {name, categories, apps} = DEFAULT_FOLDERS[folder];
const child = new Gio.Settings({ const child = new Gio.Settings({
schema_id: 'org.gnome.desktop.app-folders.folder', schema_id: 'org.gnome.desktop.app-folders.folder',
path: `${path}folders/${folder}/`, path: `${path}folders/${folder}/`,
@ -1467,7 +1467,7 @@ class AppDisplay extends BaseAppView {
global.settings.is_writable('favorite-apps') || global.settings.is_writable('favorite-apps') ||
global.settings.is_writable('app-picker-layout'); global.settings.is_writable('app-picker-layout');
this._placeholder = new AppIcon(app, { isDraggable }); this._placeholder = new AppIcon(app, {isDraggable});
this._placeholder.connect('notify::pressed', icon => { this._placeholder.connect('notify::pressed', icon => {
if (icon.pressed) if (icon.pressed)
this.updateDragFocus(icon); this.updateDragFocus(icon);
@ -1583,7 +1583,7 @@ class AppDisplay extends BaseAppView {
if (!icon) { if (!icon) {
let app = appSys.lookup_app(appId); let app = appSys.lookup_app(appId);
icon = new AppIcon(app, { isDraggable }); icon = new AppIcon(app, {isDraggable});
icon.connect('notify::pressed', () => { icon.connect('notify::pressed', () => {
if (icon.pressed) if (icon.pressed)
this.updateDragFocus(icon); this.updateDragFocus(icon);
@ -1801,7 +1801,7 @@ export class AppSearchProvider {
} }
getResultMetas(apps) { getResultMetas(apps) {
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
let metas = []; let metas = [];
for (let id of apps) { for (let id of apps) {
if (id.endsWith('.desktop')) { if (id.endsWith('.desktop')) {
@ -1823,7 +1823,7 @@ export class AppSearchProvider {
style_class: 'system-action-icon', style_class: 'system-action-icon',
}); });
metas.push({ id, name, createIcon }); metas.push({id, name, createIcon});
} }
} }
@ -1885,7 +1885,7 @@ export const AppViewItem = GObject.registerClass(
class AppViewItem extends St.Button { class AppViewItem extends St.Button {
_init(params = {}, isDraggable = true, expandTitleOnHover = true) { _init(params = {}, isDraggable = true, expandTitleOnHover = true) {
super._init({ super._init({
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
reactive: true, reactive: true,
button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO, button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO,
can_focus: true, can_focus: true,
@ -1895,7 +1895,7 @@ class AppViewItem extends St.Button {
this._delegate = this; this._delegate = this;
if (isDraggable) { if (isDraggable) {
this._draggable = DND.makeDraggable(this, { timeoutThreshold: 200 }); this._draggable = DND.makeDraggable(this, {timeoutThreshold: 200});
this._draggable.connect('drag-begin', this._onDragBegin.bind(this)); this._draggable.connect('drag-begin', this._onDragBegin.bind(this));
this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this)); this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this));
@ -1927,8 +1927,8 @@ class AppViewItem extends St.Button {
if (!this._expandTitleOnHover || !this.icon.label) if (!this._expandTitleOnHover || !this.icon.label)
return; return;
const { label } = this.icon; const {label} = this.icon;
const { clutterText } = label; const {clutterText} = label;
const layout = clutterText.get_layout(); const layout = clutterText.get_layout();
if (!layout.is_wrapped() && !layout.is_ellipsized()) if (!layout.is_wrapped() && !layout.is_ellipsized())
return; return;
@ -2188,7 +2188,7 @@ class FolderView extends BaseAppView {
let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL; let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL;
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
const style = `width: ${subSize}px; height: ${subSize}px;`; const style = `width: ${subSize}px; height: ${subSize}px;`;
let bin = new St.Bin({ style }); let bin = new St.Bin({style});
if (i < numItems) if (i < numItems)
bin.child = this._orderedItems[i].app.create_icon_texture(subSize); bin.child = this._orderedItems[i].app.create_icon_texture(subSize);
layout.attach(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2), 1, 1); layout.attach(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2), 1, 1);
@ -2288,7 +2288,7 @@ class FolderView extends BaseAppView {
for (const key of keys) for (const key of keys)
this._folder.reset(key); this._folder.reset(key);
let settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders' }); let settings = new Gio.Settings({schema_id: 'org.gnome.desktop.app-folders'});
let folders = settings.get_strv('folder-children'); let folders = settings.get_strv('folder-children');
folders.splice(folders.indexOf(this._id), 1); folders.splice(folders.indexOf(this._id), 1);
settings.set_strv('folder-children', folders); settings.set_strv('folder-children', folders);
@ -2491,7 +2491,7 @@ export const FolderIcon = GObject.registerClass({
export const AppFolderDialog = GObject.registerClass({ export const AppFolderDialog = GObject.registerClass({
Signals: { Signals: {
'open-state-changed': { param_types: [GObject.TYPE_BOOLEAN] }, 'open-state-changed': {param_types: [GObject.TYPE_BOOLEAN]},
}, },
}, class AppFolderDialog extends St.Bin { }, class AppFolderDialog extends St.Bin {
_init(source, folder, appDisplay) { _init(source, folder, appDisplay) {
@ -2502,7 +2502,7 @@ export const AppFolderDialog = GObject.registerClass({
reactive: true, reactive: true,
}); });
this.add_constraint(new Layout.MonitorConstraint({ primary: true })); this.add_constraint(new Layout.MonitorConstraint({primary: true}));
const clickAction = new Clutter.ClickAction(); const clickAction = new Clutter.ClickAction();
clickAction.connect('clicked', () => { clickAction.connect('clicked', () => {
@ -2784,7 +2784,7 @@ export const AppFolderDialog = GObject.registerClass({
_onDestroy() { _onDestroy() {
if (this._isOpen) { if (this._isOpen) {
this._isOpen = false; this._isOpen = false;
this._grabHelper.ungrab({ actor: this }); this._grabHelper.ungrab({actor: this});
this._grabHelper = null; this._grabHelper = null;
} }
@ -2865,7 +2865,7 @@ export const AppFolderDialog = GObject.registerClass({
_withinDialog(x, y) { _withinDialog(x, y) {
const childExtents = this.child.get_transformed_extents(); const childExtents = this.child.get_transformed_extents();
return childExtents.contains_point(new Graphene.Point({ x, y })); return childExtents.contains_point(new Graphene.Point({x, y}));
} }
_setupDragMonitor() { _setupDragMonitor() {
@ -2969,26 +2969,26 @@ export const AppFolderDialog = GObject.registerClass({
this._showFolderLabel(); this._showFolderLabel();
this._isOpen = false; this._isOpen = false;
this._grabHelper.ungrab({ actor: this }); this._grabHelper.ungrab({actor: this});
this.emit('open-state-changed', false); this.emit('open-state-changed', false);
} }
}); });
export const AppIcon = GObject.registerClass({ export const AppIcon = GObject.registerClass({
Signals: { Signals: {
'menu-state-changed': { param_types: [GObject.TYPE_BOOLEAN] }, 'menu-state-changed': {param_types: [GObject.TYPE_BOOLEAN]},
'sync-tooltip': {}, 'sync-tooltip': {},
}, },
}, class AppIcon extends AppViewItem { }, class AppIcon extends AppViewItem {
_init(app, iconParams = {}) { _init(app, iconParams = {}) {
// Get the isDraggable property without passing it on to the BaseIcon: // Get the isDraggable property without passing it on to the BaseIcon:
const appIconParams = Params.parse(iconParams, { isDraggable: true }, true); const appIconParams = Params.parse(iconParams, {isDraggable: true}, true);
const isDraggable = appIconParams['isDraggable']; const isDraggable = appIconParams['isDraggable'];
delete iconParams['isDraggable']; delete iconParams['isDraggable'];
const expandTitleOnHover = appIconParams['expandTitleOnHover']; const expandTitleOnHover = appIconParams['expandTitleOnHover'];
delete iconParams['expandTitleOnHover']; delete iconParams['expandTitleOnHover'];
super._init({ style_class: 'app-well-app' }, isDraggable, expandTitleOnHover); super._init({style_class: 'app-well-app'}, isDraggable, expandTitleOnHover);
this.app = app; this.app = app;
this._id = app.get_id(); this._id = app.get_id();
@ -3185,7 +3185,7 @@ export const AppIcon = GObject.registerClass({
} }
shellWorkspaceLaunch(params) { shellWorkspaceLaunch(params) {
let { stack } = new Error(); let {stack} = new Error();
log(`shellWorkspaceLaunch is deprecated, use app.open_new_window() instead\n${stack}`); log(`shellWorkspaceLaunch is deprecated, use app.open_new_window() instead\n${stack}`);
params = Params.parse(params, { params = Params.parse(params, {

View File

@ -157,7 +157,7 @@ export class AppMenu extends PopupMenu.PopupMenu {
if (!canFavorite) if (!canFavorite)
return; return;
const { id } = this._app; const {id} = this._app;
this._toggleFavoriteItem.label.text = this._appFavorites.isFavorite(id) this._toggleFavoriteItem.label.text = this._appFavorites.isFavorite(id)
? _('Unpin') ? _('Unpin')
: _('Pin to Dash'); : _('Pin to Dash');

View File

@ -21,10 +21,10 @@ const AudioDevice = {
const AudioDeviceSelectionIface = loadInterfaceXML('org.gnome.Shell.AudioDeviceSelection'); const AudioDeviceSelectionIface = loadInterfaceXML('org.gnome.Shell.AudioDeviceSelection');
const AudioDeviceSelectionDialog = GObject.registerClass({ const AudioDeviceSelectionDialog = GObject.registerClass({
Signals: { 'device-selected': { param_types: [GObject.TYPE_UINT] } }, Signals: {'device-selected': {param_types: [GObject.TYPE_UINT]}},
}, class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog { }, class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
_init(devices) { _init(devices) {
super._init({ styleClass: 'audio-device-selection-dialog' }); super._init({styleClass: 'audio-device-selection-dialog'});
this._deviceItems = {}; this._deviceItems = {};

View File

@ -187,7 +187,7 @@ class BackgroundCache extends Signals.EventEmitter {
return; return;
} }
animation = new Animation({ file: params.file }); animation = new Animation({file: params.file});
animation.load_async(null, () => { animation.load_async(null, () => {
this._animations[params.settingsSchema] = animation; this._animations[params.settingsSchema] = animation;
@ -238,7 +238,7 @@ function getBackgroundCache() {
} }
const Background = GObject.registerClass({ const Background = GObject.registerClass({
Signals: { 'loaded': {}, 'bg-changed': {} }, Signals: {'loaded': {}, 'bg-changed': {}},
}, class Background extends Meta.Background { }, class Background extends Meta.Background {
_init(params) { _init(params) {
params = Params.parse(params, { params = Params.parse(params, {
@ -249,7 +249,7 @@ const Background = GObject.registerClass({
style: null, style: null,
}); });
super._init({ meta_display: global.display }); super._init({meta_display: global.display});
this._settings = params.settings; this._settings = params.settings;
this._file = params.file; this._file = params.file;
@ -260,7 +260,7 @@ const Background = GObject.registerClass({
this._cancellable = new Gio.Cancellable(); this._cancellable = new Gio.Cancellable();
this.isLoaded = false; this.isLoaded = false;
this._interfaceSettings = new Gio.Settings({ schema_id: INTERFACE_SCHEMA }); this._interfaceSettings = new Gio.Settings({schema_id: INTERFACE_SCHEMA});
this._clock = new GnomeDesktop.WallClock(); this._clock = new GnomeDesktop.WallClock();
this._clock.connectObject('notify::timezone', this._clock.connectObject('notify::timezone',
@ -532,11 +532,11 @@ const Background = GObject.registerClass({
let _systemBackground; let _systemBackground;
export const SystemBackground = GObject.registerClass({ export const SystemBackground = GObject.registerClass({
Signals: { 'loaded': {} }, Signals: {'loaded': {}},
}, class SystemBackground extends Meta.BackgroundActor { }, class SystemBackground extends Meta.BackgroundActor {
_init() { _init() {
if (_systemBackground == null) { if (_systemBackground == null) {
_systemBackground = new Meta.Background({ meta_display: global.display }); _systemBackground = new Meta.Background({meta_display: global.display});
_systemBackground.set_color(DEFAULT_BACKGROUND_COLOR); _systemBackground.set_color(DEFAULT_BACKGROUND_COLOR);
} }
@ -559,7 +559,7 @@ class BackgroundSource {
// Allow override the background image setting for performance testing // Allow override the background image setting for performance testing
this._layoutManager = layoutManager; this._layoutManager = layoutManager;
this._overrideImage = GLib.getenv('SHELL_BACKGROUND_IMAGE'); this._overrideImage = GLib.getenv('SHELL_BACKGROUND_IMAGE');
this._settings = new Gio.Settings({ schema_id: settingsSchema }); this._settings = new Gio.Settings({schema_id: settingsSchema});
this._backgrounds = []; this._backgrounds = [];
const monitorManager = global.backend.get_monitor_manager(); const monitorManager = global.backend.get_monitor_manager();
@ -567,7 +567,7 @@ class BackgroundSource {
monitorManager.connect('monitors-changed', monitorManager.connect('monitors-changed',
this._onMonitorsChanged.bind(this)); this._onMonitorsChanged.bind(this));
this._interfaceSettings = new Gio.Settings({ schema_id: INTERFACE_SCHEMA }); this._interfaceSettings = new Gio.Settings({schema_id: INTERFACE_SCHEMA});
} }
_onMonitorsChanged() { _onMonitorsChanged() {
@ -772,7 +772,7 @@ export class BackgroundManager extends Signals.EventEmitter {
this._newBackgroundActor = newBackgroundActor; this._newBackgroundActor = newBackgroundActor;
const { background } = newBackgroundActor.content; const {background} = newBackgroundActor.content;
if (background.isLoaded) { if (background.isLoaded) {
this._swapBackgroundActor(); this._swapBackgroundActor();

View File

@ -28,7 +28,7 @@ const POPUP_ANIMATION_TIME = 150;
* *
*/ */
export const BoxPointer = GObject.registerClass({ export const BoxPointer = GObject.registerClass({
Signals: { 'arrow-side-changed': {} }, Signals: {'arrow-side-changed': {}},
}, class BoxPointer extends St.Widget { }, class BoxPointer extends St.Widget {
/** /**
* @param {*} arrowSide side to draw the arrow on * @param {*} arrowSide side to draw the arrow on

View File

@ -106,7 +106,7 @@ export const EventSourceBase = GObject.registerClass({
GObject.ParamFlags.READABLE, GObject.ParamFlags.READABLE,
false), false),
}, },
Signals: { 'changed': {} }, Signals: {'changed': {}},
}, class EventSourceBase extends GObject.Object { }, class EventSourceBase extends GObject.Object {
/** /**
* @returns {boolean} * @returns {boolean}
@ -405,17 +405,17 @@ class DBusEventSource extends EventSourceBase {
let dayBegin = _getBeginningOfDay(day); let dayBegin = _getBeginningOfDay(day);
let dayEnd = _getEndOfDay(day); let dayEnd = _getEndOfDay(day);
const { done } = this._getFilteredEvents(dayBegin, dayEnd).next(); const {done} = this._getFilteredEvents(dayBegin, dayEnd).next();
return !done; return !done;
} }
}); });
export const Calendar = GObject.registerClass({ export const Calendar = GObject.registerClass({
Signals: { 'selected-date-changed': { param_types: [GLib.DateTime.$gtype] } }, Signals: {'selected-date-changed': {param_types: [GLib.DateTime.$gtype]}},
}, class Calendar extends St.Widget { }, class Calendar extends St.Widget {
_init() { _init() {
this._weekStart = Shell.util_get_week_start(); this._weekStart = Shell.util_get_week_start();
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.calendar' }); this._settings = new Gio.Settings({schema_id: 'org.gnome.desktop.calendar'});
this._settings.connect(`changed::${SHOW_WEEKDATE_KEY}`, this._onSettingsChange.bind(this)); this._settings.connect(`changed::${SHOW_WEEKDATE_KEY}`, this._onSettingsChange.bind(this));
this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY); this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY);
@ -491,7 +491,7 @@ export const Calendar = GObject.registerClass({
this.destroy_all_children(); this.destroy_all_children();
// Top line of the calendar '<| September 2009 |>' // Top line of the calendar '<| September 2009 |>'
this._topBox = new St.BoxLayout({ style_class: 'calendar-month-header' }); this._topBox = new St.BoxLayout({style_class: 'calendar-month-header'});
layout.attach(this._topBox, 0, 0, offsetCols + 7, 1); layout.attach(this._topBox, 0, 0, offsetCols + 7, 1);
this._backButton = new St.Button({ this._backButton = new St.Button({
@ -898,13 +898,13 @@ class NotificationSection extends MessageList.MessageListSection {
const Placeholder = GObject.registerClass( const Placeholder = GObject.registerClass(
class Placeholder extends St.BoxLayout { class Placeholder extends St.BoxLayout {
_init() { _init() {
super._init({ style_class: 'message-list-placeholder', vertical: true }); super._init({style_class: 'message-list-placeholder', vertical: true});
this._date = new Date(); this._date = new Date();
this._icon = new St.Icon({ icon_name: 'no-notifications-symbolic' }); this._icon = new St.Icon({icon_name: 'no-notifications-symbolic'});
this.add_actor(this._icon); this.add_actor(this._icon);
this._label = new St.Label({ text: _('No Notifications') }); this._label = new St.Label({text: _('No Notifications')});
this.add_actor(this._label); this.add_actor(this._label);
} }
}); });
@ -957,7 +957,7 @@ class CalendarMessageList extends St.Widget {
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
box.add_actor(this._scrollView); box.add_actor(this._scrollView);
let hbox = new St.BoxLayout({ style_class: 'message-list-controls' }); let hbox = new St.BoxLayout({style_class: 'message-list-controls'});
box.add_child(hbox); box.add_child(hbox);
const dndLabel = new St.Label({ const dndLabel = new St.Label({

View File

@ -20,10 +20,10 @@ class CheckBox extends St.Button {
}); });
this.set_accessible_role(Atk.Role.CHECK_BOX); this.set_accessible_role(Atk.Role.CHECK_BOX);
this._box = new St.Bin({ y_align: Clutter.ActorAlign.START }); this._box = new St.Bin({y_align: Clutter.ActorAlign.START});
container.add_actor(this._box); container.add_actor(this._box);
this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER }); this._label = new St.Label({y_align: Clutter.ActorAlign.CENTER});
this._label.clutter_text.set_line_wrap(true); this._label.clutter_text.set_line_wrap(true);
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE); this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
this.set_label_actor(this._label); this.set_label_actor(this._label);

View File

@ -44,7 +44,7 @@ export const CloseDialog = GObject.registerClass({
let title = _('“%s” is not responding.').format(windowApp.get_name()); let title = _('“%s” is not responding.').format(windowApp.get_name());
let description = _('You may choose to wait a short while for it to ' + let description = _('You may choose to wait a short while for it to ' +
'continue or force the app to quit entirely.'); 'continue or force the app to quit entirely.');
return new Dialog.MessageDialogContent({ title, description }); return new Dialog.MessageDialogContent({title, description});
} }
_updateScale() { _updateScale() {
@ -55,7 +55,7 @@ export const CloseDialog = GObject.registerClass({
if (this._window.get_client_type() !== Meta.WindowClientType.WAYLAND) if (this._window.get_client_type() !== Meta.WindowClientType.WAYLAND)
return; return;
let { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); let {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this._dialog.set_scale(1 / scaleFactor, 1 / scaleFactor); this._dialog.set_scale(1 / scaleFactor, 1 / scaleFactor);
} }
@ -131,7 +131,7 @@ export const CloseDialog = GObject.registerClass({
if (shouldTrack) { if (shouldTrack) {
Main.layoutManager.trackChrome(this._dialog, Main.layoutManager.trackChrome(this._dialog,
{ affectsInputRegion: true }); {affectsInputRegion: true});
} else { } else {
Main.layoutManager.untrackChrome(this._dialog); Main.layoutManager.untrackChrome(this._dialog);
} }

View File

@ -18,7 +18,7 @@ const AUTORUN_EXPIRE_TIMEOUT_SECS = 10;
class AutomountManager { class AutomountManager {
constructor() { constructor() {
this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA }); this._settings = new Gio.Settings({schema_id: SETTINGS_SCHEMA});
this._activeOperations = new Map(); this._activeOperations = new Map();
this._session = new GnomeSession.SessionManager(); this._session = new GnomeSession.SessionManager();
this._session.connectSignal('InhibitorAdded', this._session.connectSignal('InhibitorAdded',
@ -227,7 +227,7 @@ class AutomountManager {
const existingDialog = prevOperation?.borrowDialog(); const existingDialog = prevOperation?.borrowDialog();
let operation = let operation =
new ShellMountOperation.ShellMountOperation(volume, new ShellMountOperation.ShellMountOperation(volume,
{ existingDialog }); {existingDialog});
this._mountVolume(volume, operation); this._mountVolume(volume, operation);
} }

View File

@ -87,7 +87,7 @@ function HotplugSniffer() {
class ContentTypeDiscoverer { class ContentTypeDiscoverer {
constructor() { constructor() {
this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA }); this._settings = new Gio.Settings({schema_id: SETTINGS_SCHEMA});
} }
async guessContentTypes(mount) { async guessContentTypes(mount) {
@ -166,7 +166,7 @@ class AutorunDispatcher {
constructor(manager) { constructor(manager) {
this._manager = manager; this._manager = manager;
this._sources = []; this._sources = [];
this._settings = new Gio.Settings({ schema_id: SETTINGS_SCHEMA }); this._settings = new Gio.Settings({schema_id: SETTINGS_SCHEMA});
} }
_getAutorunSettingForType(contentType) { _getAutorunSettingForType(contentType) {

View File

@ -17,7 +17,7 @@ import {wiggle} from '../../misc/animationUtils.js';
const KeyringDialog = GObject.registerClass( const KeyringDialog = GObject.registerClass(
class KeyringDialog extends ModalDialog.ModalDialog { class KeyringDialog extends ModalDialog.ModalDialog {
_init() { _init() {
super._init({ styleClass: 'prompt-dialog' }); super._init({styleClass: 'prompt-dialog'});
this.prompt = new Shell.KeyringPrompt(); this.prompt = new Shell.KeyringPrompt();
this.prompt.connect('show-password', this._onShowPassword.bind(this)); this.prompt.connect('show-password', this._onShowPassword.bind(this));
@ -61,7 +61,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
this.prompt.set_password_actor(this._passwordEntry.clutter_text); this.prompt.set_password_actor(this._passwordEntry.clutter_text);
this.prompt.set_confirm_actor(this._confirmEntry.clutter_text); this.prompt.set_confirm_actor(this._confirmEntry.clutter_text);
let warningBox = new St.BoxLayout({ vertical: true }); let warningBox = new St.BoxLayout({vertical: true});
let capsLockWarning = new ShellEntry.CapsLockWarning(); let capsLockWarning = new ShellEntry.CapsLockWarning();
let syncCapsLockWarningVisibility = () => { let syncCapsLockWarningVisibility = () => {
@ -72,7 +72,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
this.prompt.connect('notify::confirm-visible', syncCapsLockWarningVisibility); this.prompt.connect('notify::confirm-visible', syncCapsLockWarningVisibility);
warningBox.add_child(capsLockWarning); warningBox.add_child(capsLockWarning);
let warning = new St.Label({ style_class: 'prompt-dialog-error-label' }); let warning = new St.Label({style_class: 'prompt-dialog-error-label'});
warning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; warning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
warning.clutter_text.line_wrap = true; warning.clutter_text.line_wrap = true;
this.prompt.bind_property('warning', this.prompt.bind_property('warning',

View File

@ -24,7 +24,7 @@ const VPN_UI_GROUP = 'VPN Plugin UI';
const NetworkSecretDialog = GObject.registerClass( const NetworkSecretDialog = GObject.registerClass(
class NetworkSecretDialog extends ModalDialog.ModalDialog { class NetworkSecretDialog extends ModalDialog.ModalDialog {
_init(agent, requestId, connection, settingName, hints, flags, contentOverride) { _init(agent, requestId, connection, settingName, hints, flags, contentOverride) {
super._init({ styleClass: 'prompt-dialog' }); super._init({styleClass: 'prompt-dialog'});
this._agent = agent; this._agent = agent;
this._requestId = requestId; this._requestId = requestId;
@ -469,10 +469,10 @@ class VPNRequestHandler extends Signals.EventEmitter {
}); });
this._childPid = pid; this._childPid = pid;
this._stdin = new Gio.UnixOutputStream({ fd: stdin, close_fd: true }); this._stdin = new Gio.UnixOutputStream({fd: stdin, close_fd: true});
this._stdout = new Gio.UnixInputStream({ fd: stdout, close_fd: true }); this._stdout = new Gio.UnixInputStream({fd: stdout, close_fd: true});
GLib.close(stderr); GLib.close(stderr);
this._dataStdout = new Gio.DataInputStream({ base_stream: this._stdout }); this._dataStdout = new Gio.DataInputStream({base_stream: this._stdout});
if (this._newStylePlugin) if (this._newStylePlugin)
this._readStdoutNewStyle(); this._readStdoutNewStyle();

View File

@ -28,10 +28,10 @@ const DIALOG_ICON_SIZE = 64;
const DELAYED_RESET_TIMEOUT = 200; const DELAYED_RESET_TIMEOUT = 200;
const AuthenticationDialog = GObject.registerClass({ const AuthenticationDialog = GObject.registerClass({
Signals: { 'done': { param_types: [GObject.TYPE_BOOLEAN] } }, Signals: {'done': {param_types: [GObject.TYPE_BOOLEAN]}},
}, class AuthenticationDialog extends ModalDialog.ModalDialog { }, class AuthenticationDialog extends ModalDialog.ModalDialog {
_init(actionId, description, cookie, userNames) { _init(actionId, description, cookie, userNames) {
super._init({ styleClass: 'prompt-dialog' }); super._init({styleClass: 'prompt-dialog'});
this.actionId = actionId; this.actionId = actionId;
this.message = description; this.message = description;
@ -45,7 +45,7 @@ const AuthenticationDialog = GObject.registerClass({
let title = _('Authentication Required'); let title = _('Authentication Required');
let headerContent = new Dialog.MessageDialogContent({ title, description }); let headerContent = new Dialog.MessageDialogContent({title, description});
this.contentLayout.add_child(headerContent); this.contentLayout.add_child(headerContent);
let bodyContent = new Dialog.MessageDialogContent(); let bodyContent = new Dialog.MessageDialogContent();
@ -106,7 +106,7 @@ const AuthenticationDialog = GObject.registerClass({
GObject.BindingFlags.SYNC_CREATE); GObject.BindingFlags.SYNC_CREATE);
passwordBox.add_child(this._passwordEntry); passwordBox.add_child(this._passwordEntry);
let warningBox = new St.BoxLayout({ vertical: true }); let warningBox = new St.BoxLayout({vertical: true});
let capsLockWarning = new ShellEntry.CapsLockWarning(); let capsLockWarning = new ShellEntry.CapsLockWarning();
this._passwordEntry.bind_property('visible', this._passwordEntry.bind_property('visible',
@ -134,7 +134,7 @@ const AuthenticationDialog = GObject.registerClass({
* infoMessage and errorMessageLabel - but it is still invisible because * infoMessage and errorMessageLabel - but it is still invisible because
* gnome-shell.css sets the color to be transparent * gnome-shell.css sets the color to be transparent
*/ */
this._nullMessageLabel = new St.Label({ style_class: 'prompt-dialog-null-label' }); this._nullMessageLabel = new St.Label({style_class: 'prompt-dialog-null-label'});
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._nullMessageLabel.clutter_text.line_wrap = true; this._nullMessageLabel.clutter_text.line_wrap = true;
warningBox.add_child(this._nullMessageLabel); warningBox.add_child(this._nullMessageLabel);

View File

@ -388,9 +388,9 @@ class ChatSource extends MessageTray.Source {
getIcon() { getIcon() {
let file = this._contact.get_avatar_file(); let file = this._contact.get_avatar_file();
if (file) if (file)
return new Gio.FileIcon({ file }); return new Gio.FileIcon({file});
else else
return new Gio.ThemedIcon({ name: 'avatar-default' }); return new Gio.ThemedIcon({name: 'avatar-default'});
} }
getSecondaryIcon() { getSecondaryIcon() {
@ -419,7 +419,7 @@ class ChatSource extends MessageTray.Source {
default: default:
iconName = 'user-offline'; iconName = 'user-offline';
} }
return new Gio.ThemedIcon({ name: iconName }); return new Gio.ThemedIcon({name: iconName});
} }
_updateAvatarIcon() { _updateAvatarIcon() {
@ -427,7 +427,7 @@ class ChatSource extends MessageTray.Source {
if (this._notification) { if (this._notification) {
this._notification.update(this._notification.title, this._notification.update(this._notification.title,
this._notification.bannerBodyText, this._notification.bannerBodyText,
{ gicon: this.getIcon() }); {gicon: this.getIcon()});
} }
} }
@ -633,7 +633,7 @@ class ChatSource extends MessageTray.Source {
if (this._notification) { if (this._notification) {
this._notification.update(this._notification.title, this._notification.update(this._notification.title,
this._notification.bannerBodyText, this._notification.bannerBodyText,
{ secondaryGIcon: this.getSecondaryIcon() }); {secondaryGIcon: this.getSecondaryIcon()});
} }
} }
@ -667,14 +667,14 @@ class ChatNotificationMessage extends GObject.Object {
const ChatNotification = HAVE_TP ? GObject.registerClass({ const ChatNotification = HAVE_TP ? GObject.registerClass({
Signals: { Signals: {
'message-removed': { param_types: [ChatNotificationMessage.$gtype] }, 'message-removed': {param_types: [ChatNotificationMessage.$gtype]},
'message-added': { param_types: [ChatNotificationMessage.$gtype] }, 'message-added': {param_types: [ChatNotificationMessage.$gtype]},
'timestamp-changed': { param_types: [ChatNotificationMessage.$gtype] }, 'timestamp-changed': {param_types: [ChatNotificationMessage.$gtype]},
}, },
}, class ChatNotification extends MessageTray.Notification { }, class ChatNotification extends MessageTray.Notification {
_init(source) { _init(source) {
super._init(source, source.title, null, super._init(source, source.title, null,
{ secondaryGIcon: source.getSecondaryIcon() }); {secondaryGIcon: source.getSecondaryIcon()});
this.setUrgency(MessageTray.Urgency.HIGH); this.setUrgency(MessageTray.Urgency.HIGH);
this.setResident(true); this.setResident(true);
@ -775,7 +775,7 @@ const ChatNotification = HAVE_TP ? GObject.registerClass({
timestamp: currentTime, timestamp: currentTime,
noTimestamp: false, noTimestamp: false,
}); });
const { noTimestamp } = props; const {noTimestamp} = props;
delete props.noTimestamp; delete props.noTimestamp;
// Reset the old message timeout // Reset the old message timeout
@ -897,7 +897,7 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner {
this._oldMaxScrollValue = Math.max(adjustment.lower, adjustment.upper - adjustment.page_size); this._oldMaxScrollValue = Math.max(adjustment.lower, adjustment.upper - adjustment.page_size);
}); });
this._inputHistory = new History.HistoryManager({ entry: this._responseEntry.clutter_text }); this._inputHistory = new History.HistoryManager({entry: this._responseEntry.clutter_text});
this._composingTimeoutId = 0; this._composingTimeoutId = 0;

View File

@ -66,7 +66,7 @@ class DashItemContainer extends St.Widget {
_init() { _init() {
super._init({ super._init({
style_class: 'dash-item-container', style_class: 'dash-item-container',
pivot_point: new Graphene.Point({ x: .5, y: .5 }), pivot_point: new Graphene.Point({x: .5, y: .5}),
layout_manager: new Clutter.BinLayout(), layout_manager: new Clutter.BinLayout(),
scale_x: 0, scale_x: 0,
scale_y: 0, scale_y: 0,
@ -76,7 +76,7 @@ class DashItemContainer extends St.Widget {
}); });
this._labelText = ''; this._labelText = '';
this.label = new St.Label({ style_class: 'dash-label' }); this.label = new St.Label({style_class: 'dash-label'});
this.label.hide(); this.label.hide();
Main.layoutManager.addChrome(this.label); Main.layoutManager.addChrome(this.label);
this.label.connectObject('destroy', () => (this.label = null), this); this.label.connectObject('destroy', () => (this.label = null), this);
@ -288,7 +288,7 @@ const DragPlaceholderItem = GObject.registerClass(
class DragPlaceholderItem extends DashItemContainer { class DragPlaceholderItem extends DashItemContainer {
_init() { _init() {
super._init(); super._init();
this.setChild(new St.Bin({ style_class: 'placeholder' })); this.setChild(new St.Bin({style_class: 'placeholder'}));
} }
}); });
@ -296,7 +296,7 @@ const EmptyDropTargetItem = GObject.registerClass(
class EmptyDropTargetItem extends DashItemContainer { class EmptyDropTargetItem extends DashItemContainer {
_init() { _init() {
super._init(); super._init();
this.setChild(new St.Bin({ style_class: 'empty-dash-drop-target' })); this.setChild(new St.Bin({style_class: 'empty-dash-drop-target'}));
} }
}); });
@ -317,7 +317,7 @@ class DashIconsLayout extends Clutter.BoxLayout {
const baseIconSizes = [16, 22, 24, 32, 48, 64]; const baseIconSizes = [16, 22, 24, 32, 48, 64];
export const Dash = GObject.registerClass({ export const Dash = GObject.registerClass({
Signals: { 'icon-size-changed': {} }, Signals: {'icon-size-changed': {}},
}, class Dash extends St.Widget { }, class Dash extends St.Widget {
_init() { _init() {
this._maxWidth = -1; this._maxWidth = -1;

View File

@ -58,7 +58,7 @@ class Dialog extends St.Widget {
this._dialog.add_child(this.contentLayout); this._dialog.add_child(this.contentLayout);
this.buttonLayout = new St.Widget({ this.buttonLayout = new St.Widget({
layout_manager: new Clutter.BoxLayout({ homogeneous: true }), layout_manager: new Clutter.BoxLayout({homogeneous: true}),
}); });
this._dialog.add_child(this.buttonLayout); this._dialog.add_child(this.buttonLayout);
} }
@ -86,7 +86,7 @@ class Dialog extends St.Widget {
if (!buttonInfo) if (!buttonInfo)
return Clutter.EVENT_PROPAGATE; return Clutter.EVENT_PROPAGATE;
let { button, action } = buttonInfo; let {button, action} = buttonInfo;
if (action && button.reactive) { if (action && button.reactive) {
action(); action();
@ -111,7 +111,7 @@ class Dialog extends St.Widget {
} }
addButton(buttonInfo) { addButton(buttonInfo) {
let { label, action, key } = buttonInfo; let {label, action, key} = buttonInfo;
let isDefault = buttonInfo['default']; let isDefault = buttonInfo['default'];
let keys; let keys;
@ -170,8 +170,8 @@ export const MessageDialogContent = GObject.registerClass({
}, },
}, class MessageDialogContent extends St.BoxLayout { }, class MessageDialogContent extends St.BoxLayout {
_init(params) { _init(params) {
this._title = new St.Label({ style_class: 'message-dialog-title' }); this._title = new St.Label({style_class: 'message-dialog-title'});
this._description = new St.Label({ style_class: 'message-dialog-description' }); this._description = new St.Label({style_class: 'message-dialog-description'});
this._description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; this._description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._description.clutter_text.line_wrap = true; this._description.clutter_text.line_wrap = true;
@ -257,7 +257,7 @@ export const ListSection = GObject.registerClass({
}, },
}, class ListSection extends St.BoxLayout { }, class ListSection extends St.BoxLayout {
_init(params) { _init(params) {
this._title = new St.Label({ style_class: 'dialog-list-title' }); this._title = new St.Label({style_class: 'dialog-list-title'});
this._listScrollView = new St.ScrollView({ this._listScrollView = new St.ScrollView({
style_class: 'dialog-list-scrollview', style_class: 'dialog-list-scrollview',
@ -319,7 +319,7 @@ export const ListSectionItem = GObject.registerClass({
y_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER,
}); });
this._title = new St.Label({ style_class: 'dialog-list-item-title' }); this._title = new St.Label({style_class: 'dialog-list-item-title'});
this._description = new St.Label({ this._description = new St.Label({
style_class: 'dialog-list-item-title-description', style_class: 'dialog-list-item-title-description',
@ -328,7 +328,7 @@ export const ListSectionItem = GObject.registerClass({
textLayout.add_child(this._title); textLayout.add_child(this._title);
textLayout.add_child(this._description); textLayout.add_child(this._description);
let defaultParams = { style_class: 'dialog-list-item' }; let defaultParams = {style_class: 'dialog-list-item'};
super._init(Object.assign(defaultParams, params)); super._init(Object.assign(defaultParams, params));
this.label_actor = this._title; this.label_actor = this._title;

View File

@ -50,7 +50,7 @@ let currentDraggable = null;
function _getEventHandlerActor() { function _getEventHandlerActor() {
if (!eventHandlerActor) { if (!eventHandlerActor) {
eventHandlerActor = new Clutter.Actor({ width: 0, height: 0, reactive: true }); eventHandlerActor = new Clutter.Actor({width: 0, height: 0, reactive: true});
Main.uiGroup.add_actor(eventHandlerActor); Main.uiGroup.add_actor(eventHandlerActor);
// We connect to 'event' rather than 'captured-event' because the capturing phase doesn't happen // We connect to 'event' rather than 'captured-event' because the capturing phase doesn't happen
// when you've grabbed the pointer. // when you've grabbed the pointer.

View File

@ -13,7 +13,7 @@ const DRAG_DISTANCE = 80;
export const EdgeDragAction = GObject.registerClass({ export const EdgeDragAction = GObject.registerClass({
Signals: { Signals: {
'activated': {}, 'activated': {},
'progress': { param_types: [GObject.TYPE_DOUBLE] }, 'progress': {param_types: [GObject.TYPE_DOUBLE]},
}, },
}, class EdgeDragAction extends Clutter.GestureAction { }, class EdgeDragAction extends Clutter.GestureAction {
_init(side, allowedModes) { _init(side, allowedModes) {
@ -25,7 +25,7 @@ export const EdgeDragAction = GObject.registerClass({
} }
_getMonitorRect(x, y) { _getMonitorRect(x, y) {
let rect = new Meta.Rectangle({ x: x - 1, y: y - 1, width: 1, height: 1 }); let rect = new Meta.Rectangle({x: x - 1, y: y - 1, width: 1, height: 1});
let monitorIndex = global.display.get_monitor_index_for_rect(rect); let monitorIndex = global.display.get_monitor_index_for_rect(rect);
return global.display.get_monitor_geometry(monitorIndex); return global.display.get_monitor_geometry(monitorIndex);

View File

@ -398,7 +398,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
// Use a different description when we are installing a system upgrade // Use a different description when we are installing a system upgrade
// if the PackageKit proxy is available (i.e. PackageKit is available). // if the PackageKit proxy is available (i.e. PackageKit is available).
if (dialogContent.upgradeDescription) { if (dialogContent.upgradeDescription) {
const { name, version } = this._updateInfo.PreparedUpgrade; const {name, version} = this._updateInfo.PreparedUpgrade;
if (name != null && version != null) if (name != null && version != null)
description = dialogContent.upgradeDescription(name, version); description = dialogContent.upgradeDescription(name, version);
} }

View File

@ -159,7 +159,7 @@ function _easeActor(actor, params) {
.map(p => actor.get_transition(p)) .map(p => actor.get_transition(p))
.filter(t => t !== null); .filter(t => t !== null);
transitions.forEach(t => t.set({ repeatCount, autoReverse })); transitions.forEach(t => t.set({repeatCount, autoReverse}));
const [transition] = transitions; const [transition] = transitions;
@ -232,7 +232,7 @@ function _easeActorProperty(actor, propName, target, params) {
let pspec = actor.find_property(propName); let pspec = actor.find_property(propName);
let transition = new Clutter.PropertyTransition(Object.assign({ let transition = new Clutter.PropertyTransition(Object.assign({
property_name: propName, property_name: propName,
interval: new Clutter.Interval({ value_type: pspec.value_type }), interval: new Clutter.Interval({value_type: pspec.value_type}),
remove_on_complete: true, remove_on_complete: true,
repeat_count: repeatCount, repeat_count: repeatCount,
auto_reverse: autoReverse, auto_reverse: autoReverse,

View File

@ -95,7 +95,7 @@ export function uninstallExtension(uuid) {
* @throws * @throws
*/ */
function checkResponse(message) { function checkResponse(message) {
const { statusCode } = message; const {statusCode} = message;
const phrase = Soup.Status.get_phrase(statusCode); const phrase = Soup.Status.get_phrase(statusCode);
if (statusCode !== Soup.Status.OK) if (statusCode !== Soup.Status.OK)
throw new Error(`Unexpected response: ${phrase}`); throw new Error(`Unexpected response: ${phrase}`);
@ -159,7 +159,7 @@ export async function downloadExtensionUpdate(uuid) {
const dir = Gio.File.new_for_path( const dir = Gio.File.new_for_path(
GLib.build_filenamev([global.userdatadir, 'extension-updates', uuid])); GLib.build_filenamev([global.userdatadir, 'extension-updates', uuid]));
const params = { shell_version: Config.PACKAGE_VERSION }; const params = {shell_version: Config.PACKAGE_VERSION};
const message = Soup.Message.new_from_encoded_form('GET', const message = Soup.Message.new_from_encoded_form('GET',
REPOSITORY_URL_DOWNLOAD.format(uuid), REPOSITORY_URL_DOWNLOAD.format(uuid),
Soup.form_encode_hash(params)); Soup.form_encode_hash(params));
@ -246,7 +246,7 @@ export async function checkForUpdates() {
const InstallExtensionDialog = GObject.registerClass( const InstallExtensionDialog = GObject.registerClass(
class InstallExtensionDialog extends ModalDialog.ModalDialog { class InstallExtensionDialog extends ModalDialog.ModalDialog {
_init(uuid, info, invocation) { _init(uuid, info, invocation) {
super._init({ styleClass: 'extension-dialog' }); super._init({styleClass: 'extension-dialog'});
this._uuid = uuid; this._uuid = uuid;
this._info = info; this._info = info;
@ -278,7 +278,7 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
async _onInstallButtonPressed() { async _onInstallButtonPressed() {
this.close(); this.close();
const params = { shell_version: Config.PACKAGE_VERSION }; const params = {shell_version: Config.PACKAGE_VERSION};
const message = Soup.Message.new_from_encoded_form('GET', const message = Soup.Message.new_from_encoded_form('GET',
REPOSITORY_URL_DOWNLOAD.format(this._uuid), REPOSITORY_URL_DOWNLOAD.format(this._uuid),
Soup.form_encode_hash(params)); Soup.form_encode_hash(params));

View File

@ -465,7 +465,7 @@ export class ExtensionManager extends Signals.EventEmitter {
} }
async unloadExtension(extension) { async unloadExtension(extension) {
const { uuid, type } = extension; const {uuid, type} = extension;
// Try to disable it -- if it's ERROR'd, we can't guarantee that, // Try to disable it -- if it's ERROR'd, we can't guarantee that,
// but it will be removed on next reboot, and hopefully nothing // but it will be removed on next reboot, and hopefully nothing
@ -486,7 +486,7 @@ export class ExtensionManager extends Signals.EventEmitter {
async reloadExtension(oldExtension) { async reloadExtension(oldExtension) {
// Grab the things we'll need to pass to createExtensionObject // Grab the things we'll need to pass to createExtensionObject
// to reload it. // to reload it.
let { uuid, dir, type } = oldExtension; let {uuid, dir, type} = oldExtension;
// Then unload the old extension. // Then unload the old extension.
await this.unloadExtension(oldExtension); await this.unloadExtension(oldExtension);

View File

@ -246,7 +246,7 @@ export class GrabHelper {
if (type == Clutter.EventType.KEY_PRESS && if (type == Clutter.EventType.KEY_PRESS &&
event.get_key_symbol() == Clutter.KEY_Escape) { event.get_key_symbol() == Clutter.KEY_Escape) {
this.ungrab({ isUser: true }); this.ungrab({isUser: true});
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;
} }
@ -286,7 +286,7 @@ export class GrabHelper {
this._ignoreUntilRelease = true; this._ignoreUntilRelease = true;
let i = this._actorInGrabStack(targetActor) + 1; let i = this._actorInGrabStack(targetActor) + 1;
this.ungrab({ actor: this._grabStack[i].actor, isUser: true }); this.ungrab({actor: this._grabStack[i].actor, isUser: true});
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;
} }

View File

@ -41,8 +41,8 @@ const CandidateArea = GObject.registerClass({
reactive: true, reactive: true,
track_hover: true, track_hover: true,
}); });
box._indexLabel = new St.Label({ style_class: 'candidate-index' }); box._indexLabel = new St.Label({style_class: 'candidate-index'});
box._candidateLabel = new St.Label({ style_class: 'candidate-label' }); box._candidateLabel = new St.Label({style_class: 'candidate-label'});
box.add_child(box._indexLabel); box.add_child(box._indexLabel);
box.add_child(box._candidateLabel); box.add_child(box._candidateLabel);
this._candidateBoxes.push(box); this._candidateBoxes.push(box);
@ -55,7 +55,7 @@ const CandidateArea = GObject.registerClass({
}); });
} }
this._buttonBox = new St.BoxLayout({ style_class: 'candidate-page-button-box' }); this._buttonBox = new St.BoxLayout({style_class: 'candidate-page-button-box'});
this._previousButton = new St.Button({ this._previousButton = new St.Button({
style_class: 'candidate-page-button candidate-page-button-previous button', style_class: 'candidate-page-button candidate-page-button-previous button',
@ -152,7 +152,7 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
this.visible = false; this.visible = false;
this.style_class = 'candidate-popup-boxpointer'; this.style_class = 'candidate-popup-boxpointer';
this._dummyCursor = new Clutter.Actor({ opacity: 0 }); this._dummyCursor = new Clutter.Actor({opacity: 0});
Main.layoutManager.uiGroup.add_actor(this._dummyCursor); Main.layoutManager.uiGroup.add_actor(this._dummyCursor);
Main.layoutManager.addTopChrome(this); Main.layoutManager.addTopChrome(this);
@ -328,7 +328,7 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
// so don't raise to the top. // so don't raise to the top.
// The on-screen keyboard is expected to be above any entries, // The on-screen keyboard is expected to be above any entries,
// so just above the keyboard gets us to the right layer. // so just above the keyboard gets us to the right layer.
const { keyboardBox } = Main.layoutManager; const {keyboardBox} = Main.layoutManager;
this.get_parent().set_child_above_sibling(this, keyboardBox); this.get_parent().set_child_above_sibling(this, keyboardBox);
} else { } else {
this.close(BoxPointer.PopupAnimation.NONE); this.close(BoxPointer.PopupAnimation.NONE);

View File

@ -73,7 +73,7 @@ class BaseIcon extends Shell.SquareBin {
if (params.showLabel) if (params.showLabel)
styleClass += ' overview-icon-with-label'; styleClass += ' overview-icon-with-label';
super._init({ style_class: styleClass }); super._init({style_class: styleClass});
this._box = new St.BoxLayout({ this._box = new St.BoxLayout({
vertical: true, vertical: true,
@ -83,12 +83,12 @@ class BaseIcon extends Shell.SquareBin {
this.set_child(this._box); this.set_child(this._box);
this.iconSize = ICON_SIZE; this.iconSize = ICON_SIZE;
this._iconBin = new St.Bin({ x_align: Clutter.ActorAlign.CENTER }); this._iconBin = new St.Bin({x_align: Clutter.ActorAlign.CENTER});
this._box.add_actor(this._iconBin); this._box.add_actor(this._iconBin);
if (params.showLabel) { if (params.showLabel) {
this.label = new St.Label({ text: label }); this.label = new St.Label({text: label});
this.label.clutter_text.set({ this.label.clutter_text.set({
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER,
@ -142,7 +142,7 @@ class BaseIcon extends Shell.SquareBin {
if (this._setSizeManually) { if (this._setSizeManually) {
size = this.iconSize; size = this.iconSize;
} else { } else {
const { scaleFactor } = const {scaleFactor} =
St.ThemeContext.get_for_stage(global.stage); St.ThemeContext.get_for_stage(global.stage);
let [found, len] = node.lookup_length('icon-size', false); let [found, len] = node.lookup_length('icon-size', false);
@ -526,7 +526,7 @@ export const IconGridLayout = GObject.registerClass({
} }
_appendPage() { _appendPage() {
this._pages.push({ children: [] }); this._pages.push({children: []});
this.emit('pages-changed'); this.emit('pages-changed');
} }
@ -1226,7 +1226,7 @@ export const IconGrid = GObject.registerClass({
} }
_findBestModeForSize(width, height) { _findBestModeForSize(width, height) {
const { pagePadding } = this.layout_manager; const {pagePadding} = this.layout_manager;
width -= pagePadding.left + pagePadding.right; width -= pagePadding.left + pagePadding.right;
height -= pagePadding.top + pagePadding.bottom; height -= pagePadding.top + pagePadding.bottom;

View File

@ -15,7 +15,7 @@ class KbdA11yDialog extends GObject.Object {
_init() { _init() {
super._init(); super._init();
this._a11ySettings = new Gio.Settings({ schema_id: KEYBOARD_A11Y_SCHEMA }); this._a11ySettings = new Gio.Settings({schema_id: KEYBOARD_A11Y_SCHEMA});
let seat = Clutter.get_default_backend().get_default_seat(); let seat = Clutter.get_default_backend().get_default_seat();
seat.connect('kbd-a11y-flags-changed', seat.connect('kbd-a11y-flags-changed',
@ -50,7 +50,7 @@ class KbdA11yDialog extends GObject.Object {
return; return;
} }
let content = new Dialog.MessageDialogContent({ title, description }); let content = new Dialog.MessageDialogContent({title, description});
dialog.contentLayout.add_child(content); dialog.contentLayout.add_child(content);
dialog.addButton({ dialog.addButton({

View File

@ -176,7 +176,7 @@ class Suggestions extends St.BoxLayout {
} }
add(word, callback) { add(word, callback) {
let button = new St.Button({ label: word }); let button = new St.Button({label: word});
button.connect('button-press-event', () => { button.connect('button-press-event', () => {
callback(); callback();
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;
@ -272,7 +272,7 @@ const Key = GObject.registerClass({
}, class Key extends St.BoxLayout { }, class Key extends St.BoxLayout {
_init(params, extendedKeys = []) { _init(params, extendedKeys = []) {
const {label, iconName, commitString, keyval} = {keyval: 0, ...params}; const {label, iconName, commitString, keyval} = {keyval: 0, ...params};
super._init({ style_class: 'key-container' }); super._init({style_class: 'key-container'});
this._keyval = parseInt(keyval, 16); this._keyval = parseInt(keyval, 16);
this.keyButton = this._makeKey(commitString, label, iconName); this.keyButton = this._makeKey(commitString, label, iconName);
@ -659,7 +659,7 @@ const EmojiPager = GObject.registerClass({
GLib.MININT32, GLib.MAXINT32, 0), GLib.MININT32, GLib.MAXINT32, 0),
}, },
Signals: { Signals: {
'emoji': { param_types: [GObject.TYPE_STRING] }, 'emoji': {param_types: [GObject.TYPE_STRING]},
'page-changed': { 'page-changed': {
param_types: [GObject.TYPE_INT, GObject.TYPE_INT, GObject.TYPE_INT], param_types: [GObject.TYPE_INT, GObject.TYPE_INT, GObject.TYPE_INT],
}, },
@ -813,7 +813,7 @@ const EmojiPager = GObject.registerClass({
if (j % itemsPerPage == 0) { if (j % itemsPerPage == 0) {
page++; page++;
pageKeys = []; pageKeys = [];
this._pages.push({ pageKeys, nPages, page, section: this._sections[i] }); this._pages.push({pageKeys, nPages, page, section: this._sections[i]});
} }
pageKeys.push(section.keys[j]); pageKeys.push(section.keys[j]);
@ -936,7 +936,7 @@ const EmojiPager = GObject.registerClass({
const EmojiSelection = GObject.registerClass({ const EmojiSelection = GObject.registerClass({
Signals: { Signals: {
'emoji-selected': { param_types: [GObject.TYPE_STRING] }, 'emoji-selected': {param_types: [GObject.TYPE_STRING]},
'close-request': {}, 'close-request': {},
'toggle': {}, 'toggle': {},
}, },
@ -956,15 +956,15 @@ const EmojiSelection = GObject.registerClass({
}); });
this._sections = [ this._sections = [
{ first: 'grinning face', label: '🙂️' }, {first: 'grinning face', label: '🙂️'},
{ first: 'selfie', label: '👍️' }, {first: 'selfie', label: '👍️'},
{ first: 'monkey face', label: '🌷️' }, {first: 'monkey face', label: '🌷️'},
{ first: 'grapes', label: '🍴️' }, {first: 'grapes', label: '🍴️'},
{ first: 'globe showing Europe-Africa', label: '✈️' }, {first: 'globe showing Europe-Africa', label: '✈️'},
{ first: 'jack-o-lantern', label: '🏃️' }, {first: 'jack-o-lantern', label: '🏃️'},
{ first: 'muted speaker', label: '🔔️' }, {first: 'muted speaker', label: '🔔️'},
{ first: 'ATM sign', label: '❤️' }, {first: 'ATM sign', label: '❤️'},
{ first: 'chequered flag', label: '🚩️' }, {first: 'chequered flag', label: '🚩️'},
]; ];
this._gridLayout = gridLayout; this._gridLayout = gridLayout;
@ -1057,7 +1057,7 @@ const EmojiSelection = GObject.registerClass({
/* Create the key */ /* Create the key */
let label = emoji[currentKey].char + String.fromCharCode(0xFE0F); let label = emoji[currentKey].char + String.fromCharCode(0xFE0F);
currentSection.keys.push({ label, variants }); currentSection.keys.push({label, variants});
currentKey = i; currentKey = i;
variants = []; variants = [];
} }
@ -1121,23 +1121,23 @@ const EmojiSelection = GObject.registerClass({
const Keypad = GObject.registerClass({ const Keypad = GObject.registerClass({
Signals: { Signals: {
'keyval': { param_types: [GObject.TYPE_UINT] }, 'keyval': {param_types: [GObject.TYPE_UINT]},
}, },
}, class Keypad extends AspectContainer { }, class Keypad extends AspectContainer {
_init() { _init() {
let keys = [ let keys = [
{ label: '1', keyval: Clutter.KEY_1, left: 0, top: 0 }, {label: '1', keyval: Clutter.KEY_1, left: 0, top: 0},
{ label: '2', keyval: Clutter.KEY_2, left: 1, top: 0 }, {label: '2', keyval: Clutter.KEY_2, left: 1, top: 0},
{ label: '3', keyval: Clutter.KEY_3, left: 2, top: 0 }, {label: '3', keyval: Clutter.KEY_3, left: 2, top: 0},
{ label: '4', keyval: Clutter.KEY_4, left: 0, top: 1 }, {label: '4', keyval: Clutter.KEY_4, left: 0, top: 1},
{ label: '5', keyval: Clutter.KEY_5, left: 1, top: 1 }, {label: '5', keyval: Clutter.KEY_5, left: 1, top: 1},
{ label: '6', keyval: Clutter.KEY_6, left: 2, top: 1 }, {label: '6', keyval: Clutter.KEY_6, left: 2, top: 1},
{ label: '7', keyval: Clutter.KEY_7, left: 0, top: 2 }, {label: '7', keyval: Clutter.KEY_7, left: 0, top: 2},
{ label: '8', keyval: Clutter.KEY_8, left: 1, top: 2 }, {label: '8', keyval: Clutter.KEY_8, left: 1, top: 2},
{ label: '9', keyval: Clutter.KEY_9, left: 2, top: 2 }, {label: '9', keyval: Clutter.KEY_9, left: 2, top: 2},
{ label: '0', keyval: Clutter.KEY_0, left: 1, top: 3 }, {label: '0', keyval: Clutter.KEY_0, left: 1, top: 3},
{ keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic', left: 3, top: 0 }, {keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic', left: 3, top: 0},
{ keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic', left: 3, top: 1, height: 2 }, {keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic', left: 3, top: 1, height: 2},
]; ];
super._init({ super._init({
@ -1151,7 +1151,7 @@ const Keypad = GObject.registerClass({
column_homogeneous: true, column_homogeneous: true,
row_homogeneous: true, row_homogeneous: true,
}); });
this._box = new St.Widget({ layout_manager: gridLayout, x_expand: true, y_expand: true }); this._box = new St.Widget({layout_manager: gridLayout, x_expand: true, y_expand: true});
this.add_child(this._box); this.add_child(this._box);
for (let i = 0; i < keys.length; i++) { for (let i = 0; i < keys.length; i++) {
@ -1181,7 +1181,7 @@ export class KeyboardManager extends Signals.EventEmitter {
super(); super();
this._keyboard = null; this._keyboard = null;
this._a11yApplicationsSettings = new Gio.Settings({ schema_id: A11Y_APPLICATIONS_SCHEMA }); this._a11yApplicationsSettings = new Gio.Settings({schema_id: A11Y_APPLICATIONS_SCHEMA});
this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this)); this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this));
this._seat = Clutter.get_default_backend().get_default_seat(); this._seat = Clutter.get_default_backend().get_default_seat();

View File

@ -219,7 +219,7 @@ export const LayoutManager = GObject.registerClass({
this._pendingLoadBackground = false; this._pendingLoadBackground = false;
// Set up stage hierarchy to group all UI actors under one container. // Set up stage hierarchy to group all UI actors under one container.
this.uiGroup = new UiActor({ name: 'uiGroup' }); this.uiGroup = new UiActor({name: 'uiGroup'});
this.uiGroup.set_flags(Clutter.ActorFlags.NO_LAYOUT); this.uiGroup.set_flags(Clutter.ActorFlags.NO_LAYOUT);
global.stage.add_child(this.uiGroup); global.stage.add_child(this.uiGroup);
@ -308,7 +308,7 @@ export const LayoutManager = GObject.registerClass({
// A dummy actor that tracks the mouse or text cursor, based on the // A dummy actor that tracks the mouse or text cursor, based on the
// position and size set in setDummyCursorGeometry. // position and size set in setDummyCursorGeometry.
this.dummyCursor = new St.Widget({ width: 0, height: 0, opacity: 0 }); this.dummyCursor = new St.Widget({width: 0, height: 0, opacity: 0});
this.uiGroup.add_actor(this.dummyCursor); this.uiGroup.add_actor(this.dummyCursor);
let feedbackGroup = Meta.get_feedback_group_for_display(global.display); let feedbackGroup = Meta.get_feedback_group_for_display(global.display);
@ -984,7 +984,7 @@ export const LayoutManager = GObject.registerClass({
findIndexForActor(actor) { findIndexForActor(actor) {
let [x, y] = actor.get_transformed_position(); let [x, y] = actor.get_transformed_position();
let [w, h] = actor.get_transformed_size(); let [w, h] = actor.get_transformed_size();
let rect = new Meta.Rectangle({ x, y, width: w, height: h }); let rect = new Meta.Rectangle({x, y, width: w, height: h});
return global.display.get_monitor_index_for_rect(rect); return global.display.get_monitor_index_for_rect(rect);
} }
@ -1048,7 +1048,7 @@ export const LayoutManager = GObject.registerClass({
h = Math.round(h); h = Math.round(h);
if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility()) if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility())
rects.push(new Meta.Rectangle({ x, y, width: w, height: h })); rects.push(new Meta.Rectangle({x, y, width: w, height: h}));
let monitor = null; let monitor = null;
if (actorData.affectsStruts) if (actorData.affectsStruts)
@ -1098,8 +1098,8 @@ export const LayoutManager = GObject.registerClass({
continue; continue;
} }
let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 }); let strutRect = new Meta.Rectangle({x: x1, y: y1, width: x2 - x1, height: y2 - y1});
let strut = new Meta.Strut({ rect: strutRect, side }); let strut = new Meta.Strut({rect: strutRect, side});
struts.push(strut); struts.push(strut);
} }
} }
@ -1445,7 +1445,7 @@ class PressureBarrier extends Signals.EventEmitter {
const ScreenTransition = GObject.registerClass( const ScreenTransition = GObject.registerClass(
class ScreenTransition extends Clutter.Actor { class ScreenTransition extends Clutter.Actor {
_init() { _init() {
super._init({ visible: false }); super._init({visible: false});
} }
vfunc_hide() { vfunc_hide() {

View File

@ -140,9 +140,9 @@ export const Lightbox = GObject.registerClass({
this._radialEffect = params.radialEffect; this._radialEffect = params.radialEffect;
if (this._radialEffect) if (this._radialEffect)
this.add_effect(new RadialShaderEffect({ name: 'radial' })); this.add_effect(new RadialShaderEffect({name: 'radial'}));
else else
this.set({ opacity: 0, style_class: 'lightbox' }); this.set({opacity: 0, style_class: 'lightbox'});
container.add_actor(this); container.add_actor(this);
container.set_child_above_sibling(this, null); container.set_child_above_sibling(this, null);
@ -209,7 +209,7 @@ export const Lightbox = GObject.registerClass({
'@effects.radial.brightness', VIGNETTE_BRIGHTNESS, easeProps); '@effects.radial.brightness', VIGNETTE_BRIGHTNESS, easeProps);
this.ease_property( this.ease_property(
'@effects.radial.sharpness', VIGNETTE_SHARPNESS, '@effects.radial.sharpness', VIGNETTE_SHARPNESS,
Object.assign({ onComplete }, easeProps)); Object.assign({onComplete}, easeProps));
} else { } else {
this.ease(Object.assign(easeProps, { this.ease(Object.assign(easeProps, {
opacity: 255 * this._fadeFactor, opacity: 255 * this._fadeFactor,
@ -235,9 +235,9 @@ export const Lightbox = GObject.registerClass({
this.ease_property( this.ease_property(
'@effects.radial.brightness', 1.0, easeProps); '@effects.radial.brightness', 1.0, easeProps);
this.ease_property( this.ease_property(
'@effects.radial.sharpness', 0.0, Object.assign({ onComplete }, easeProps)); '@effects.radial.sharpness', 0.0, Object.assign({onComplete}, easeProps));
} else { } else {
this.ease(Object.assign(easeProps, { opacity: 0, onComplete })); this.ease(Object.assign(easeProps, {opacity: 0, onComplete}));
} }
} }

View File

@ -9,7 +9,7 @@ const LOCATE_POINTER_SCHEMA = 'org.gnome.desktop.interface';
export class LocatePointer { export class LocatePointer {
constructor() { constructor() {
this._settings = new Gio.Settings({ schema_id: LOCATE_POINTER_SCHEMA }); this._settings = new Gio.Settings({schema_id: LOCATE_POINTER_SCHEMA});
this._settings.connect(`changed::${LOCATE_POINTER_KEY}`, () => this._syncEnabled()); this._settings.connect(`changed::${LOCATE_POINTER_KEY}`, () => this._syncEnabled());
this._syncEnabled(); this._syncEnabled();
} }

View File

@ -49,8 +49,8 @@ const LG_ANIMATION_TIME = 500;
const CLUTTER_DEBUG_FLAG_CATEGORIES = new Map([ const CLUTTER_DEBUG_FLAG_CATEGORIES = new Map([
// Paint debugging can easily result in a non-responsive session // Paint debugging can easily result in a non-responsive session
['DebugFlag', { argPos: 0, exclude: ['PAINT'] }], ['DebugFlag', {argPos: 0, exclude: ['PAINT']}],
['DrawDebugFlag', { argPos: 1, exclude: [] }], ['DrawDebugFlag', {argPos: 1, exclude: []}],
// Exluded due to the only current option likely to result in shooting ones // Exluded due to the only current option likely to result in shooting ones
// foot // foot
// ['PickDebugFlag', { argPos: 2, exclude: [] }], // ['PickDebugFlag', { argPos: 2, exclude: [] }],
@ -83,17 +83,17 @@ class AutoComplete extends Signals.EventEmitter {
// multiple matches + double tab = emit a suggest event with all possible options // multiple matches + double tab = emit a suggest event with all possible options
if (event.completions.length == 1) { if (event.completions.length == 1) {
this.additionalCompletionText(event.completions[0], event.attrHead); this.additionalCompletionText(event.completions[0], event.attrHead);
this.emit('completion', { completion: event.completions[0], type: 'whole-word' }); this.emit('completion', {completion: event.completions[0], type: 'whole-word'});
} else if (event.completions.length > 1 && event.tabType === 'single') { } else if (event.completions.length > 1 && event.tabType === 'single') {
let commonPrefix = JsParse.getCommonPrefix(event.completions); let commonPrefix = JsParse.getCommonPrefix(event.completions);
if (commonPrefix.length > 0) { if (commonPrefix.length > 0) {
this.additionalCompletionText(commonPrefix, event.attrHead); this.additionalCompletionText(commonPrefix, event.attrHead);
this.emit('completion', { completion: commonPrefix, type: 'prefix' }); this.emit('completion', {completion: commonPrefix, type: 'prefix'});
this.emit('suggest', { completions: event.completions }); this.emit('suggest', {completions: event.completions});
} }
} else if (event.completions.length > 1 && event.tabType === 'double') { } else if (event.completions.length > 1 && event.tabType === 'double') {
this.emit('suggest', { completions: event.completions }); this.emit('suggest', {completions: event.completions});
} }
} }
@ -134,7 +134,7 @@ class AutoComplete extends Signals.EventEmitter {
} }
const Notebook = GObject.registerClass({ const Notebook = GObject.registerClass({
Signals: { 'selection': { param_types: [Clutter.Actor.$gtype] } }, Signals: {'selection': {param_types: [Clutter.Actor.$gtype]}},
}, class Notebook extends St.BoxLayout { }, class Notebook extends St.BoxLayout {
_init() { _init() {
super._init({ super._init({
@ -142,7 +142,7 @@ const Notebook = GObject.registerClass({
y_expand: true, y_expand: true,
}); });
this.tabControls = new St.BoxLayout({ style_class: 'labels' }); this.tabControls = new St.BoxLayout({style_class: 'labels'});
this._selectedIndex = -1; this._selectedIndex = -1;
this._tabs = []; this._tabs = [];
@ -154,7 +154,7 @@ const Notebook = GObject.registerClass({
reactive: true, reactive: true,
track_hover: true, track_hover: true,
}); });
let label = new St.Button({ label: name }); let label = new St.Button({label: name});
label.connect('clicked', () => { label.connect('clicked', () => {
this.selectChild(child); this.selectChild(child);
return true; return true;
@ -162,7 +162,7 @@ const Notebook = GObject.registerClass({
labelBox.add_child(label); labelBox.add_child(label);
this.tabControls.add(labelBox); this.tabControls.add(labelBox);
let scrollview = new St.ScrollView({ y_expand: true }); let scrollview = new St.ScrollView({y_expand: true});
scrollview.get_hscroll_bar().hide(); scrollview.get_hscroll_bar().hide();
scrollview.add_actor(child); scrollview.add_actor(child);
@ -310,19 +310,19 @@ class ObjLink extends St.Button {
const Result = GObject.registerClass( const Result = GObject.registerClass(
class Result extends St.BoxLayout { class Result extends St.BoxLayout {
_init(lookingGlass, command, o, index) { _init(lookingGlass, command, o, index) {
super._init({ vertical: true }); super._init({vertical: true});
this.index = index; this.index = index;
this.o = o; this.o = o;
this._lookingGlass = lookingGlass; this._lookingGlass = lookingGlass;
let cmdTxt = new St.Label({ text: command }); let cmdTxt = new St.Label({text: command});
cmdTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END; cmdTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END;
this.add(cmdTxt); this.add(cmdTxt);
let box = new St.BoxLayout({}); let box = new St.BoxLayout({});
this.add(box); this.add(box);
let resultTxt = new St.Label({ text: `r(${index}) = ` }); let resultTxt = new St.Label({text: `r(${index}) = `});
resultTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END; resultTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END;
box.add(resultTxt); box.add(resultTxt);
let objLink = new ObjLink(this._lookingGlass, o); let objLink = new ObjLink(this._lookingGlass, o);
@ -333,7 +333,7 @@ class Result extends St.BoxLayout {
const WindowList = GObject.registerClass({ const WindowList = GObject.registerClass({
}, class WindowList extends St.BoxLayout { }, class WindowList extends St.BoxLayout {
_init(lookingGlass) { _init(lookingGlass) {
super._init({ name: 'Windows', vertical: true, style: 'spacing: 8px' }); super._init({name: 'Windows', vertical: true, style: 'spacing: 8px'});
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
this._updateId = Main.initializeDeferredWork(this, this._updateWindowList.bind(this)); this._updateId = Main.initializeDeferredWork(this, this._updateWindowList.bind(this));
global.display.connect('window-created', this._updateWindowList.bind(this)); global.display.connect('window-created', this._updateWindowList.bind(this));
@ -356,24 +356,24 @@ const WindowList = GObject.registerClass({
metaWindow.connect('unmanaged', this._updateWindowList.bind(this)); metaWindow.connect('unmanaged', this._updateWindowList.bind(this));
metaWindow._lookingGlassManaged = true; metaWindow._lookingGlassManaged = true;
} }
let box = new St.BoxLayout({ vertical: true }); let box = new St.BoxLayout({vertical: true});
this.add(box); this.add(box);
let windowLink = new ObjLink(this._lookingGlass, metaWindow, metaWindow.title); let windowLink = new ObjLink(this._lookingGlass, metaWindow, metaWindow.title);
box.add_child(windowLink); box.add_child(windowLink);
let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' }); let propsBox = new St.BoxLayout({vertical: true, style: 'padding-left: 6px;'});
box.add(propsBox); box.add(propsBox);
propsBox.add(new St.Label({ text: `wmclass: ${metaWindow.get_wm_class()}` })); propsBox.add(new St.Label({text: `wmclass: ${metaWindow.get_wm_class()}`}));
let app = tracker.get_window_app(metaWindow); let app = tracker.get_window_app(metaWindow);
if (app != null && !app.is_window_backed()) { if (app != null && !app.is_window_backed()) {
let icon = app.create_icon_texture(22); let icon = app.create_icon_texture(22);
let propBox = new St.BoxLayout({ style: 'spacing: 6px; ' }); let propBox = new St.BoxLayout({style: 'spacing: 6px; '});
propsBox.add(propBox); propsBox.add(propBox);
propBox.add_child(new St.Label({ text: 'app: ' })); propBox.add_child(new St.Label({text: 'app: '}));
let appLink = new ObjLink(this._lookingGlass, app, app.get_id()); let appLink = new ObjLink(this._lookingGlass, app, app.get_id());
propBox.add_child(appLink); propBox.add_child(appLink);
propBox.add_child(icon); propBox.add_child(icon);
} else { } else {
propsBox.add(new St.Label({ text: '<untracked>' })); propsBox.add(new St.Label({text: '<untracked>'}));
} }
} }
} }
@ -387,7 +387,7 @@ const ObjInspector = GObject.registerClass(
class ObjInspector extends St.ScrollView { class ObjInspector extends St.ScrollView {
_init(lookingGlass) { _init(lookingGlass) {
super._init({ super._init({
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
}); });
this._obj = null; this._obj = null;
@ -417,7 +417,7 @@ class ObjInspector extends St.ScrollView {
this._container.destroy_all_children(); this._container.destroy_all_children();
let hbox = new St.BoxLayout({ style_class: 'lg-obj-inspector-title' }); let hbox = new St.BoxLayout({style_class: 'lg-obj-inspector-title'});
this._container.add_actor(hbox); this._container.add_actor(hbox);
let label = new St.Label({ let label = new St.Label({
text: `Inspecting: ${typeof obj}: ${objectToString(obj)}`, text: `Inspecting: ${typeof obj}: ${objectToString(obj)}`,
@ -425,12 +425,12 @@ class ObjInspector extends St.ScrollView {
}); });
label.single_line_mode = true; label.single_line_mode = true;
hbox.add_child(label); hbox.add_child(label);
let button = new St.Button({ label: 'Insert', style_class: 'lg-obj-inspector-button' }); let button = new St.Button({label: 'Insert', style_class: 'lg-obj-inspector-button'});
button.connect('clicked', this._onInsert.bind(this)); button.connect('clicked', this._onInsert.bind(this));
hbox.add(button); hbox.add(button);
if (this._previousObj != null) { if (this._previousObj != null) {
button = new St.Button({ label: 'Back', style_class: 'lg-obj-inspector-button' }); button = new St.Button({label: 'Back', style_class: 'lg-obj-inspector-button'});
button.connect('clicked', this._onBack.bind(this)); button.connect('clicked', this._onBack.bind(this));
hbox.add(button); hbox.add(button);
} }
@ -454,10 +454,10 @@ class ObjInspector extends St.ScrollView {
let prop = obj[propName]; let prop = obj[propName];
link = new ObjLink(this._lookingGlass, prop); link = new ObjLink(this._lookingGlass, prop);
} catch (e) { } catch (e) {
link = new St.Label({ text: '<error>' }); link = new St.Label({text: '<error>'});
} }
let box = new St.BoxLayout(); let box = new St.BoxLayout();
box.add(new St.Label({ text: `${propName}: ` })); box.add(new St.Label({text: `${propName}: `}));
box.add(link); box.add(link);
this._container.add_actor(box); this._container.add_actor(box);
} }
@ -468,7 +468,7 @@ class ObjInspector extends St.ScrollView {
if (this._open) if (this._open)
return; return;
const grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS }); const grab = Main.pushModal(this, {actionMode: Shell.ActionMode.LOOKING_GLASS});
if (grab.get_seat_state() !== Clutter.GrabState.ALL) { if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
Main.popModal(grab); Main.popModal(grab);
return; return;
@ -577,11 +577,11 @@ class RedBorderEffect extends Clutter.Effect {
const Inspector = GObject.registerClass({ const Inspector = GObject.registerClass({
Signals: { Signals: {
'closed': {}, 'closed': {},
'target': { param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, 'target': {param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
}, },
}, class Inspector extends Clutter.Actor { }, class Inspector extends Clutter.Actor {
_init(lookingGlass) { _init(lookingGlass) {
super._init({ width: 0, height: 0 }); super._init({width: 0, height: 0});
Main.uiGroup.add_actor(this); Main.uiGroup.add_actor(this);
@ -592,7 +592,7 @@ const Inspector = GObject.registerClass({
}); });
this._eventHandler = eventHandler; this._eventHandler = eventHandler;
this.add_actor(eventHandler); this.add_actor(eventHandler);
this._displayText = new St.Label({ x_expand: true }); this._displayText = new St.Label({x_expand: true});
eventHandler.add_child(this._displayText); eventHandler.add_child(this._displayText);
eventHandler.connect('key-press-event', this._onKeyPressEvent.bind(this)); eventHandler.connect('key-press-event', this._onKeyPressEvent.bind(this));
@ -718,7 +718,7 @@ const Inspector = GObject.registerClass({
const Extensions = GObject.registerClass({ const Extensions = GObject.registerClass({
}, class Extensions extends St.BoxLayout { }, class Extensions extends St.BoxLayout {
_init(lookingGlass) { _init(lookingGlass) {
super._init({ vertical: true, name: 'lookingGlassExtensions' }); super._init({vertical: true, name: 'lookingGlassExtensions'});
this._lookingGlass = lookingGlass; this._lookingGlass = lookingGlass;
this._noExtensions = new St.Label({ this._noExtensions = new St.Label({
@ -753,7 +753,7 @@ const Extensions = GObject.registerClass({
this._extensionsList.remove_actor(this._noExtensions); this._extensionsList.remove_actor(this._noExtensions);
this._numExtensions++; this._numExtensions++;
const { name } = extension.metadata; const {name} = extension.metadata;
const pos = [...this._extensionsList].findIndex( const pos = [...this._extensionsList].findIndex(
dsp => dsp._extension.metadata.name.localeCompare(name) > 0); dsp => dsp._extension.metadata.name.localeCompare(name) > 0);
this._extensionsList.insert_child_at_index(extensionDisplay, pos); this._extensionsList.insert_child_at_index(extensionDisplay, pos);
@ -778,14 +778,14 @@ const Extensions = GObject.registerClass({
if (shouldShow) { if (shouldShow) {
let errors = extension.errors; let errors = extension.errors;
let errorDisplay = new St.BoxLayout({ vertical: true }); let errorDisplay = new St.BoxLayout({vertical: true});
if (errors && errors.length) { if (errors && errors.length) {
for (let i = 0; i < errors.length; i++) for (let i = 0; i < errors.length; i++)
errorDisplay.add(new St.Label({ text: errors[i] })); errorDisplay.add(new St.Label({text: errors[i]}));
} else { } else {
/* Translators: argument is an extension UUID. */ /* Translators: argument is an extension UUID. */
let message = _('%s has not emitted any errors.').format(extension.uuid); let message = _('%s has not emitted any errors.').format(extension.uuid);
errorDisplay.add(new St.Label({ text: message })); errorDisplay.add(new St.Label({text: message}));
} }
actor._errorDisplay = errorDisplay; actor._errorDisplay = errorDisplay;
@ -822,7 +822,7 @@ const Extensions = GObject.registerClass({
} }
_createExtensionDisplay(extension) { _createExtensionDisplay(extension) {
let box = new St.BoxLayout({ style_class: 'lg-extension', vertical: true }); let box = new St.BoxLayout({style_class: 'lg-extension', vertical: true});
box._extension = extension; box._extension = extension;
let name = new St.Label({ let name = new St.Label({
style_class: 'lg-extension-name', style_class: 'lg-extension-name',
@ -837,7 +837,7 @@ const Extensions = GObject.registerClass({
}); });
box.add_child(description); box.add_child(description);
let metaBox = new St.BoxLayout({ style_class: 'lg-extension-meta' }); let metaBox = new St.BoxLayout({style_class: 'lg-extension-meta'});
box.add(metaBox); box.add(metaBox);
const state = new St.Label({ const state = new St.Label({
style_class: 'lg-extension-state', style_class: 'lg-extension-state',
@ -895,7 +895,7 @@ const ActorLink = GObject.registerClass({
icon_size: 8, icon_size: 8,
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER,
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
}); });
const label = new St.Label({ const label = new St.Label({
@ -1002,7 +1002,7 @@ class ActorTreeViewer extends St.BoxLayout {
this._lookingGlass.inspectObject(actor, button); this._lookingGlass.inspectObject(actor, button);
}); });
const mainContainer = new St.BoxLayout({ vertical: true }); const mainContainer = new St.BoxLayout({vertical: true});
const childrenContainer = new St.BoxLayout({ const childrenContainer = new St.BoxLayout({
vertical: true, vertical: true,
style: 'padding: 0 0 0 18px', style: 'padding: 0 0 0 18px',
@ -1298,7 +1298,7 @@ class LookingGlass extends St.BoxLayout {
// Sort of magic, but...eh. // Sort of magic, but...eh.
this._maxItems = 150; this._maxItems = 150;
this._interfaceSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' }); this._interfaceSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'});
this._interfaceSettings.connect('changed::monospace-font-name', this._interfaceSettings.connect('changed::monospace-font-name',
this._updateFont.bind(this)); this._updateFont.bind(this));
this._updateFont(); this._updateFont();
@ -1316,7 +1316,7 @@ class LookingGlass extends St.BoxLayout {
Main.uiGroup.add_actor(this._objInspector); Main.uiGroup.add_actor(this._objInspector);
this._objInspector.hide(); this._objInspector.hide();
let toolbar = new St.BoxLayout({ name: 'Toolbar' }); let toolbar = new St.BoxLayout({name: 'Toolbar'});
this.add_actor(toolbar); this.add_actor(toolbar);
const inspectButton = new St.Button({ const inspectButton = new St.Button({
style_class: 'lg-toolbar-button', style_class: 'lg-toolbar-button',
@ -1360,11 +1360,11 @@ class LookingGlass extends St.BoxLayout {
this._notebook = notebook; this._notebook = notebook;
this.add_child(notebook); this.add_child(notebook);
let emptyBox = new St.Bin({ x_expand: true }); let emptyBox = new St.Bin({x_expand: true});
toolbar.add_child(emptyBox); toolbar.add_child(emptyBox);
toolbar.add_actor(notebook.tabControls); toolbar.add_actor(notebook.tabControls);
this._evalBox = new St.BoxLayout({ name: 'EvalBox', vertical: true }); this._evalBox = new St.BoxLayout({name: 'EvalBox', vertical: true});
notebook.appendPage('Evaluator', this._evalBox); notebook.appendPage('Evaluator', this._evalBox);
this._resultsArea = new St.BoxLayout({ this._resultsArea = new St.BoxLayout({
@ -1380,7 +1380,7 @@ class LookingGlass extends St.BoxLayout {
}); });
this._evalBox.add_actor(this._entryArea); this._evalBox.add_actor(this._entryArea);
let label = new St.Label({ text: CHEVRON }); let label = new St.Label({text: CHEVRON});
this._entryArea.add(label); this._entryArea.add(label);
this._entry = new St.Entry({ this._entry = new St.Entry({
@ -1479,7 +1479,7 @@ class LookingGlass extends St.BoxLayout {
_showCompletions(completions) { _showCompletions(completions) {
if (!this._completionActor) { if (!this._completionActor) {
this._completionActor = new St.Label({ name: 'LookingGlassAutoCompletionText', style_class: 'lg-completions-text' }); this._completionActor = new St.Label({name: 'LookingGlassAutoCompletionText', style_class: 'lg-completions-text'});
this._completionActor.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; this._completionActor.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._completionActor.clutter_text.line_wrap = true; this._completionActor.clutter_text.line_wrap = true;
this._evalBox.insert_child_below(this._completionActor, this._entryArea); this._evalBox.insert_child_below(this._completionActor, this._entryArea);
@ -1624,7 +1624,7 @@ class LookingGlass extends St.BoxLayout {
if (this._open) if (this._open)
return; return;
let grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS }); let grab = Main.pushModal(this, {actionMode: Shell.ActionMode.LOOKING_GLASS});
if (grab.get_seat_state() !== Clutter.GrabState.ALL) { if (grab.get_seat_state() !== Clutter.GrabState.ALL) {
Main.popModal(grab); Main.popModal(grab);
return; return;

View File

@ -105,7 +105,7 @@ export class Magnifier extends Signals.EventEmitter {
let cursorTracker = Meta.CursorTracker.get_for_display(global.display); let cursorTracker = Meta.CursorTracker.get_for_display(global.display);
this._cursorTracker = cursorTracker; this._cursorTracker = cursorTracker;
this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE }); this._mouseSprite = new Clutter.Actor({request_mode: Clutter.RequestMode.CONTENT_SIZE});
this._mouseSprite.content = new MouseSpriteContent(); this._mouseSprite.content = new MouseSpriteContent();
this._cursorRoot = new Clutter.Actor(); this._cursorRoot = new Clutter.Actor();
@ -553,7 +553,7 @@ export class Magnifier extends Signals.EventEmitter {
} }
_settingsInit(zoomRegion) { _settingsInit(zoomRegion) {
this._settings = new Gio.Settings({ schema_id: MAGNIFIER_SCHEMA }); this._settings = new Gio.Settings({schema_id: MAGNIFIER_SCHEMA});
this._settings.connect(`changed::${SCREEN_POSITION_KEY}`, this._settings.connect(`changed::${SCREEN_POSITION_KEY}`,
this._updateScreenPosition.bind(this)); this._updateScreenPosition.bind(this));
@ -772,8 +772,8 @@ class ZoomRegion {
this._screenPosition = GDesktopEnums.MagnifierScreenPosition.FULL_SCREEN; this._screenPosition = GDesktopEnums.MagnifierScreenPosition.FULL_SCREEN;
this._invertLightness = false; this._invertLightness = false;
this._colorSaturation = 1.0; this._colorSaturation = 1.0;
this._brightness = { r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE }; this._brightness = {r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE};
this._contrast = { r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE }; this._contrast = {r: NO_CHANGE, g: NO_CHANGE, b: NO_CHANGE};
this._magView = null; this._magView = null;
this._background = null; this._background = null;
@ -878,7 +878,7 @@ class ZoomRegion {
throw new Error(`Failed to validate parent window: ${e}`); throw new Error(`Failed to validate parent window: ${e}`);
} }
const { focusWindow } = global.display; const {focusWindow} = global.display;
if (!focusWindow) if (!focusWindow)
return null; return null;
@ -1298,7 +1298,7 @@ class ZoomRegion {
scrollToMousePos() { scrollToMousePos() {
this._followingCursor = true; this._followingCursor = true;
if (this._mouseTrackingMode != GDesktopEnums.MagnifierMouseTrackingMode.NONE) if (this._mouseTrackingMode != GDesktopEnums.MagnifierMouseTrackingMode.NONE)
this._changeROI({ redoCursorTracking: true }); this._changeROI({redoCursorTracking: true});
else else
this._updateMousePosition(); this._updateMousePosition();
@ -1476,14 +1476,14 @@ class ZoomRegion {
_createActors() { _createActors() {
// The root actor for the zoom region // The root actor for the zoom region
this._magView = new St.Bin({ style_class: 'magnifier-zoom-region' }); this._magView = new St.Bin({style_class: 'magnifier-zoom-region'});
global.stage.add_actor(this._magView); global.stage.add_actor(this._magView);
// hide the magnified region from CLUTTER_PICK_ALL // hide the magnified region from CLUTTER_PICK_ALL
Shell.util_set_hidden_from_pick(this._magView, true); Shell.util_set_hidden_from_pick(this._magView, true);
// Add a group to clip the contents of the magnified view. // Add a group to clip the contents of the magnified view.
let mainGroup = new Clutter.Actor({ clip_to_allocation: true }); let mainGroup = new Clutter.Actor({clip_to_allocation: true});
this._magView.set_child(mainGroup); this._magView.set_child(mainGroup);
// Add a background for when the magnified uiGroup is scrolled // Add a background for when the magnified uiGroup is scrolled
@ -1502,7 +1502,7 @@ class ZoomRegion {
// Add either the given mouseSourceActor to the ZoomRegion, or a clone of // Add either the given mouseSourceActor to the ZoomRegion, or a clone of
// it. // it.
if (this._mouseSourceActor.get_parent() != null) if (this._mouseSourceActor.get_parent() != null)
this._mouseActor = new Clutter.Clone({ source: this._mouseSourceActor }); this._mouseActor = new Clutter.Clone({source: this._mouseSourceActor});
else else
this._mouseActor = this._mouseSourceActor; this._mouseActor = this._mouseSourceActor;
mainGroup.add_actor(this._mouseActor); mainGroup.add_actor(this._mouseActor);
@ -1555,7 +1555,7 @@ class ZoomRegion {
this._updateMagViewGeometry(); this._updateMagViewGeometry();
if (!fromROIUpdate) if (!fromROIUpdate)
this._changeROI({ redoCursorTracking: this._followingCursor }); // will update mouse this._changeROI({redoCursorTracking: this._followingCursor}); // will update mouse
if (this.isActive() && this._isMouseOverRegion()) if (this.isActive() && this._isMouseOverRegion())
this._magnifier.hideSystemCursor(); this._magnifier.hideSystemCursor();
@ -1885,7 +1885,7 @@ class Crosshairs extends Clutter.Actor {
if (container) { if (container) {
crosshairsActor = this; crosshairsActor = this;
if (this.get_parent() != null) { if (this.get_parent() != null) {
crosshairsActor = new Clutter.Clone({ source: this }); crosshairsActor = new Clutter.Clone({source: this});
this._clones.push(crosshairsActor); this._clones.push(crosshairsActor);
// Clones don't share visibility. // Clones don't share visibility.

View File

@ -363,7 +363,7 @@ export const Message = GObject.registerClass({
let titleBox = new St.BoxLayout(); let titleBox = new St.BoxLayout();
contentBox.add_actor(titleBox); contentBox.add_actor(titleBox);
this.titleLabel = new St.Label({ style_class: 'message-title' }); this.titleLabel = new St.Label({style_class: 'message-title'});
this.setTitle(title); this.setTitle(title);
titleBox.add_actor(this.titleLabel); titleBox.add_actor(this.titleLabel);
@ -381,7 +381,7 @@ export const Message = GObject.registerClass({
}); });
titleBox.add_actor(this._closeButton); titleBox.add_actor(this._closeButton);
this._bodyStack = new St.Widget({ x_expand: true }); this._bodyStack = new St.Widget({x_expand: true});
this._bodyStack.layout_manager = new LabelExpanderLayout(); this._bodyStack.layout_manager = new LabelExpanderLayout();
contentBox.add_actor(this._bodyStack); contentBox.add_actor(this._bodyStack);
@ -569,7 +569,7 @@ export const MessageListSection = GObject.registerClass({
Signals: { Signals: {
'can-clear-changed': {}, 'can-clear-changed': {},
'empty-changed': {}, 'empty-changed': {},
'message-focused': { param_types: [Message.$gtype] }, 'message-focused': {param_types: [Message.$gtype]},
}, },
}, class MessageListSection extends St.BoxLayout { }, class MessageListSection extends St.BoxLayout {
_init() { _init() {
@ -628,7 +628,7 @@ export const MessageListSection = GObject.registerClass({
let listItem = new St.Bin({ let listItem = new St.Bin({
child: message, child: message,
layout_manager: new ScaleLayout(), layout_manager: new ScaleLayout(),
pivot_point: new Graphene.Point({ x: .5, y: .5 }), pivot_point: new Graphene.Point({x: .5, y: .5}),
}); });
listItem._connectionsIds = []; listItem._connectionsIds = [];
@ -645,7 +645,7 @@ export const MessageListSection = GObject.registerClass({
this._list.insert_child_at_index(listItem, index); this._list.insert_child_at_index(listItem, index);
if (animate) { if (animate) {
listItem.set({ scale_x: 0, scale_y: 0 }); listItem.set({scale_x: 0, scale_y: 0});
listItem.ease({ listItem.ease({
scale_x: 1, scale_x: 1,
scale_y: 1, scale_y: 1,

View File

@ -199,7 +199,7 @@ export const NotificationGenericPolicy = GObject.registerClass({
super._init(); super._init();
this.id = 'generic'; this.id = 'generic';
this._masterSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications' }); this._masterSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.notifications'});
this._masterSettings.connect('changed', this._changed.bind(this)); this._masterSettings.connect('changed', this._changed.bind(this));
} }
@ -231,7 +231,7 @@ export const NotificationApplicationPolicy = GObject.registerClass({
this.id = id; this.id = id;
this._canonicalId = this._canonicalizeId(id); this._canonicalId = this._canonicalizeId(id);
this._masterSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications' }); this._masterSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.notifications'});
this._settings = new Gio.Settings({ this._settings = new Gio.Settings({
schema_id: 'org.gnome.desktop.notifications.application', schema_id: 'org.gnome.desktop.notifications.application',
path: `/org/gnome/desktop/notifications/application/${this._canonicalId}/`, path: `/org/gnome/desktop/notifications/application/${this._canonicalId}/`,
@ -360,8 +360,8 @@ export const Notification = GObject.registerClass({
}, },
Signals: { Signals: {
'activated': {}, 'activated': {},
'destroy': { param_types: [GObject.TYPE_UINT] }, 'destroy': {param_types: [GObject.TYPE_UINT]},
'updated': { param_types: [GObject.TYPE_BOOLEAN] }, 'updated': {param_types: [GObject.TYPE_BOOLEAN]},
}, },
}, class Notification extends GObject.Object { }, class Notification extends GObject.Object {
_init(source, title, banner, params) { _init(source, title, banner, params) {
@ -441,7 +441,7 @@ export const Notification = GObject.registerClass({
// @label: the label for the action's button // @label: the label for the action's button
// @callback: the callback for the action // @callback: the callback for the action
addAction(label, callback) { addAction(label, callback) {
this.actions.push({ label, callback }); this.actions.push({label, callback});
} }
setUrgency(urgency) { setUrgency(urgency) {
@ -656,14 +656,14 @@ export const Source = GObject.registerClass({
null), null),
}, },
Signals: { Signals: {
'destroy': { param_types: [GObject.TYPE_UINT] }, 'destroy': {param_types: [GObject.TYPE_UINT]},
'icon-updated': {}, 'icon-updated': {},
'notification-added': { param_types: [Notification.$gtype] }, 'notification-added': {param_types: [Notification.$gtype]},
'notification-show': { param_types: [Notification.$gtype] }, 'notification-show': {param_types: [Notification.$gtype]},
}, },
}, class Source extends GObject.Object { }, class Source extends GObject.Object {
_init(title, iconName) { _init(title, iconName) {
super._init({ title }); super._init({title});
this.SOURCE_ICON_SIZE = 48; this.SOURCE_ICON_SIZE = 48;
@ -735,7 +735,7 @@ export const Source = GObject.registerClass({
} }
getIcon() { getIcon() {
return new Gio.ThemedIcon({ name: this.iconName }); return new Gio.ThemedIcon({name: this.iconName});
} }
_onNotificationDestroy(notification) { _onNotificationDestroy(notification) {
@ -809,8 +809,8 @@ SignalTracker.registerDestroyableType(Source);
export const MessageTray = GObject.registerClass({ export const MessageTray = GObject.registerClass({
Signals: { Signals: {
'queue-changed': {}, 'queue-changed': {},
'source-added': { param_types: [Source.$gtype] }, 'source-added': {param_types: [Source.$gtype]},
'source-removed': { param_types: [Source.$gtype] }, 'source-removed': {param_types: [Source.$gtype]},
}, },
}, class MessageTray extends St.Widget { }, class MessageTray extends St.Widget {
_init() { _init() {
@ -829,7 +829,7 @@ export const MessageTray = GObject.registerClass({
this._onStatusChanged(status); this._onStatusChanged(status);
}); });
let constraint = new Layout.MonitorConstraint({ primary: true }); let constraint = new Layout.MonitorConstraint({primary: true});
Main.layoutManager.panelBox.bind_property('visible', Main.layoutManager.panelBox.bind_property('visible',
constraint, 'work-area', constraint, 'work-area',
GObject.BindingFlags.SYNC_CREATE); GObject.BindingFlags.SYNC_CREATE);
@ -877,8 +877,8 @@ export const MessageTray = GObject.registerClass({
this._notificationTimeoutId = 0; this._notificationTimeoutId = 0;
this._notificationRemoved = false; this._notificationRemoved = false;
Main.layoutManager.addChrome(this, { affectsInputRegion: false }); Main.layoutManager.addChrome(this, {affectsInputRegion: false});
Main.layoutManager.trackChrome(this._bannerBin, { affectsInputRegion: true }); Main.layoutManager.trackChrome(this._bannerBin, {affectsInputRegion: true});
global.display.connect('in-fullscreen-changed', this._updateState.bind(this)); global.display.connect('in-fullscreen-changed', this._updateState.bind(this));
@ -904,7 +904,7 @@ export const MessageTray = GObject.registerClass({
this._onDragEnd.bind(this)); this._onDragEnd.bind(this));
Main.wm.addKeybinding('focus-active-notification', Main.wm.addKeybinding('focus-active-notification',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.NONE, Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW, Shell.ActionMode.OVERVIEW,

View File

@ -32,7 +32,7 @@ export const ModalDialog = GObject.registerClass({
Math.max(...Object.values(State)), Math.max(...Object.values(State)),
State.CLOSED), State.CLOSED),
}, },
Signals: { 'opened': {}, 'closed': {} }, Signals: {'opened': {}, 'closed': {}},
}, class ModalDialog extends St.Widget { }, class ModalDialog extends St.Widget {
_init(params) { _init(params) {
super._init({ super._init({
@ -73,7 +73,7 @@ export const ModalDialog = GObject.registerClass({
x_expand: true, x_expand: true,
y_expand: true, y_expand: true,
}); });
this._backgroundBin = new St.Bin({ child: this.backgroundStack }); this._backgroundBin = new St.Bin({child: this.backgroundStack});
this._monitorConstraint = new Layout.MonitorConstraint(); this._monitorConstraint = new Layout.MonitorConstraint();
this._backgroundBin.add_constraint(this._monitorConstraint); this._backgroundBin.add_constraint(this._monitorConstraint);
this.add_actor(this._backgroundBin); this.add_actor(this._backgroundBin);
@ -89,7 +89,7 @@ export const ModalDialog = GObject.registerClass({
}); });
this._lightbox.highlight(this._backgroundBin); this._lightbox.highlight(this._backgroundBin);
this._eventBlocker = new Clutter.Actor({ reactive: true }); this._eventBlocker = new Clutter.Actor({reactive: true});
this.backgroundStack.add_actor(this._eventBlocker); this.backgroundStack.add_actor(this._eventBlocker);
} }
@ -237,7 +237,7 @@ export const ModalDialog = GObject.registerClass({
if (this._hasModal) if (this._hasModal)
return true; return true;
let params = { actionMode: this._actionMode }; let params = {actionMode: this._actionMode};
if (timestamp) if (timestamp)
params['timestamp'] = timestamp; params['timestamp'] = timestamp;
let grab = Main.pushModal(this, params); let grab = Main.pushModal(this, params);

View File

@ -27,7 +27,7 @@ class MediaMessage extends MessageList.Message {
this._player = player; this._player = player;
this._icon = new St.Icon({ style_class: 'media-message-cover-icon' }); this._icon = new St.Icon({style_class: 'media-message-cover-icon'});
this.setIcon(this._icon); this.setIcon(this._icon);
// reclaim space used by unused elements // reclaim space used by unused elements

View File

@ -67,17 +67,17 @@ class FdoNotificationDaemon {
stockIcon = 'dialog-error'; stockIcon = 'dialog-error';
break; break;
} }
return new Gio.ThemedIcon({ name: stockIcon }); return new Gio.ThemedIcon({name: stockIcon});
} }
_iconForNotificationData(icon) { _iconForNotificationData(icon) {
if (icon) { if (icon) {
if (icon.substr(0, 7) == 'file://') if (icon.substr(0, 7) == 'file://')
return new Gio.FileIcon({ file: Gio.File.new_for_uri(icon) }); return new Gio.FileIcon({file: Gio.File.new_for_uri(icon)});
else if (icon[0] == '/') else if (icon[0] == '/')
return new Gio.FileIcon({ file: Gio.File.new_for_path(icon) }); return new Gio.FileIcon({file: Gio.File.new_for_path(icon)});
else else
return new Gio.ThemedIcon({ name: icon }); return new Gio.ThemedIcon({name: icon});
} }
return null; return null;
} }
@ -139,7 +139,7 @@ class FdoNotificationDaemon {
hints[hint] = hints[hint].deepUnpack(); hints[hint] = hints[hint].deepUnpack();
} }
hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true); hints = Params.parse(hints, {urgency: Urgency.NORMAL}, true);
// Filter out chat, presence, calls and invitation notifications from // Filter out chat, presence, calls and invitation notifications from
// Empathy, since we handle that information from telepathyClient.js // Empathy, since we handle that information from telepathyClient.js
@ -200,8 +200,8 @@ class FdoNotificationDaemon {
} }
_notifyForSource(source, ndata) { _notifyForSource(source, ndata) {
const { icon, summary, body, actions, hints } = ndata; const {icon, summary, body, actions, hints} = ndata;
let { notification } = ndata; let {notification} = ndata;
if (notification == null) { if (notification == null) {
notification = new MessageTray.Notification(source); notification = new MessageTray.Notification(source);
@ -524,7 +524,7 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
} }
_onButtonClicked(button) { _onButtonClicked(button) {
let { action, target } = button; let {action, target} = button;
this._activateAction(action.unpack(), target); this._activateAction(action.unpack(), target);
} }

View File

@ -12,7 +12,7 @@ import * as Main from './main.js';
const OsdMonitorLabel = GObject.registerClass( const OsdMonitorLabel = GObject.registerClass(
class OsdMonitorLabel extends St.Widget { class OsdMonitorLabel extends St.Widget {
_init(monitor, label) { _init(monitor, label) {
super._init({ x_expand: true, y_expand: true }); super._init({x_expand: true, y_expand: true});
this._monitor = monitor; this._monitor = monitor;

View File

@ -25,7 +25,7 @@ class OsdWindow extends Clutter.Actor {
}); });
this._monitorIndex = monitorIndex; this._monitorIndex = monitorIndex;
let constraint = new Layout.MonitorConstraint({ index: monitorIndex }); let constraint = new Layout.MonitorConstraint({index: monitorIndex});
this.add_constraint(constraint); this.add_constraint(constraint);
this._hbox = new St.BoxLayout({ this._hbox = new St.BoxLayout({
@ -33,7 +33,7 @@ class OsdWindow extends Clutter.Actor {
}); });
this.add_actor(this._hbox); this.add_actor(this._hbox);
this._icon = new St.Icon({ y_expand: true }); this._icon = new St.Icon({y_expand: true});
this._hbox.add_child(this._icon); this._hbox.add_child(this._icon);
this._vbox = new St.BoxLayout({ this._vbox = new St.BoxLayout({

View File

@ -56,7 +56,7 @@ class ShellInfo {
notification.setForFeedback(forFeedback); notification.setForFeedback(forFeedback);
} else { } else {
notification = this._source.notifications[0]; notification = this._source.notifications[0];
notification.update(text, null, { clear: true }); notification.update(text, null, {clear: true});
} }
if (undoCallback) if (undoCallback)
@ -77,7 +77,7 @@ class OverviewActor extends St.BoxLayout {
vertical: true, vertical: true,
}); });
this.add_constraint(new LayoutManager.MonitorConstraint({ primary: true })); this.add_constraint(new LayoutManager.MonitorConstraint({primary: true}));
this._controls = new OverviewControls.ControlsManager(); this._controls = new OverviewControls.ControlsManager();
this.add_child(this._controls); this.add_child(this._controls);
@ -239,7 +239,7 @@ export class Overview extends Signals.EventEmitter {
} }
_sessionUpdated() { _sessionUpdated() {
const { hasOverview } = Main.sessionMode; const {hasOverview} = Main.sessionMode;
if (!hasOverview) if (!hasOverview)
this.hide(); this.hide();
@ -268,7 +268,7 @@ export class Overview extends Signals.EventEmitter {
Main.wm.addKeybinding( Main.wm.addKeybinding(
'toggle-overview', 'toggle-overview',
new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }), new Gio.Settings({schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
this.toggle.bind(this)); this.toggle.bind(this));
@ -276,7 +276,7 @@ export class Overview extends Signals.EventEmitter {
const swipeTracker = new SwipeTracker.SwipeTracker(global.stage, const swipeTracker = new SwipeTracker.SwipeTracker(global.stage,
Clutter.Orientation.VERTICAL, Clutter.Orientation.VERTICAL,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
{ allowDrag: false, allowScroll: false }); {allowDrag: false, allowScroll: false});
swipeTracker.orientation = Clutter.Orientation.VERTICAL; swipeTracker.orientation = Clutter.Orientation.VERTICAL;
swipeTracker.connect('begin', this._gestureBegin.bind(this)); swipeTracker.connect('begin', this._gestureBegin.bind(this));
swipeTracker.connect('update', this._gestureUpdate.bind(this)); swipeTracker.connect('update', this._gestureUpdate.bind(this));

View File

@ -37,7 +37,7 @@ const ControlsManagerLayout = GObject.registerClass(
class ControlsManagerLayout extends Clutter.BoxLayout { class ControlsManagerLayout extends Clutter.BoxLayout {
_init(searchEntry, appDisplay, workspacesDisplay, workspacesThumbnails, _init(searchEntry, appDisplay, workspacesDisplay, workspacesThumbnails,
searchController, dash, stateAdjustment) { searchController, dash, stateAdjustment) {
super._init({ orientation: Clutter.Orientation.VERTICAL }); super._init({orientation: Clutter.Orientation.VERTICAL});
this._appDisplay = appDisplay; this._appDisplay = appDisplay;
this._workspacesDisplay = workspacesDisplay; this._workspacesDisplay = workspacesDisplay;
@ -160,7 +160,7 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
vfunc_allocate(container, box) { vfunc_allocate(container, box) {
const childBox = new Clutter.ActorBox(); const childBox = new Clutter.ActorBox();
const { spacing } = this; const {spacing} = this;
const startY = this._workAreaBox.y1; const startY = this._workAreaBox.y1;
box.y1 += startY; box.y1 += startY;
@ -190,7 +190,7 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
// Workspace Thumbnails // Workspace Thumbnails
let thumbnailsHeight = 0; let thumbnailsHeight = 0;
if (this._workspacesThumbnails.visible) { if (this._workspacesThumbnails.visible) {
const { expandFraction } = this._workspacesThumbnails; const {expandFraction} = this._workspacesThumbnails;
[thumbnailsHeight] = [thumbnailsHeight] =
this._workspacesThumbnails.get_preferred_height(width); this._workspacesThumbnails.get_preferred_height(width);
thumbnailsHeight = Math.min( thumbnailsHeight = Math.min(
@ -433,14 +433,14 @@ class ControlsManager extends St.Widget {
}, },
}); });
this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA }); this._a11ySettings = new Gio.Settings({schema_id: A11Y_SCHEMA});
this._lastOverlayKeyTime = 0; this._lastOverlayKeyTime = 0;
global.display.connect('overlay-key', () => { global.display.connect('overlay-key', () => {
if (this._a11ySettings.get_boolean('stickykeys-enable')) if (this._a11ySettings.get_boolean('stickykeys-enable'))
return; return;
const { initialState, finalState, transitioning } = const {initialState, finalState, transitioning} =
this._stateAdjustment.getStateTransitionParams(); this._stateAdjustment.getStateTransitionParams();
const time = GLib.get_monotonic_time() / 1000; const time = GLib.get_monotonic_time() / 1000;
@ -466,7 +466,7 @@ class ControlsManager extends St.Widget {
!this.contains(global.stage.key_focus)) !this.contains(global.stage.key_focus))
return Clutter.EVENT_PROPAGATE; return Clutter.EVENT_PROPAGATE;
const { finalState } = const {finalState} =
this._stateAdjustment.getStateTransitionParams(); this._stateAdjustment.getStateTransitionParams();
let keynavDisplay; let keynavDisplay;
@ -494,13 +494,13 @@ class ControlsManager extends St.Widget {
Main.wm.addKeybinding( Main.wm.addKeybinding(
'toggle-application-view', 'toggle-application-view',
new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }), new Gio.Settings({schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
this._toggleAppsPage.bind(this)); this._toggleAppsPage.bind(this));
Main.wm.addKeybinding('shift-overview-up', Main.wm.addKeybinding('shift-overview-up',
new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }), new Gio.Settings({schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
() => this._shiftState(Meta.MotionDirection.UP)); () => this._shiftState(Meta.MotionDirection.UP));
@ -529,7 +529,7 @@ class ControlsManager extends St.Widget {
} }
_getThumbnailsBoxParams() { _getThumbnailsBoxParams() {
const { initialState, finalState, progress } = const {initialState, finalState, progress} =
this._stateAdjustment.getStateTransitionParams(); this._stateAdjustment.getStateTransitionParams();
const paramsForState = s => { const paramsForState = s => {
@ -553,7 +553,7 @@ class ControlsManager extends St.Widget {
break; break;
} }
return { opacity, scale, translationY }; return {opacity, scale, translationY};
}; };
const initialParams = paramsForState(initialState); const initialParams = paramsForState(initialState);
@ -567,8 +567,8 @@ class ControlsManager extends St.Widget {
} }
_updateThumbnailsBox(animate = false) { _updateThumbnailsBox(animate = false) {
const { shouldShow } = this._thumbnailsBox; const {shouldShow} = this._thumbnailsBox;
const { searchActive } = this._searchController; const {searchActive} = this._searchController;
const [opacity, scale, translationY] = this._getThumbnailsBoxParams(); const [opacity, scale, translationY] = this._getThumbnailsBoxParams();
const thumbnailsBoxVisible = shouldShow && !searchActive && opacity !== 0; const thumbnailsBoxVisible = shouldShow && !searchActive && opacity !== 0;
@ -597,7 +597,7 @@ class ControlsManager extends St.Widget {
if (!stateTransitionParams) if (!stateTransitionParams)
stateTransitionParams = this._stateAdjustment.getStateTransitionParams(); stateTransitionParams = this._stateAdjustment.getStateTransitionParams();
const { initialState, finalState } = stateTransitionParams; const {initialState, finalState} = stateTransitionParams;
const state = Math.max(initialState, finalState); const state = Math.max(initialState, finalState);
this._appDisplay.visible = this._appDisplay.visible =
@ -613,7 +613,7 @@ class ControlsManager extends St.Widget {
this._getFitModeForState(params.finalState), this._getFitModeForState(params.finalState),
params.progress); params.progress);
const { fitModeAdjustment } = this._workspacesDisplay; const {fitModeAdjustment} = this._workspacesDisplay;
fitModeAdjustment.value = fitMode; fitModeAdjustment.value = fitMode;
this._updateThumbnailsBox(); this._updateThumbnailsBox();
@ -621,7 +621,7 @@ class ControlsManager extends St.Widget {
} }
_onSearchChanged() { _onSearchChanged() {
const { searchActive } = this._searchController; const {searchActive} = this._searchController;
if (!searchActive) { if (!searchActive) {
this._updateAppDisplayVisibility(); this._updateAppDisplayVisibility();
@ -681,7 +681,7 @@ class ControlsManager extends St.Widget {
} }
_shiftState(direction) { _shiftState(direction) {
let { currentState, finalState } = this._stateAdjustment.getStateTransitionParams(); let {currentState, finalState} = this._stateAdjustment.getStateTransitionParams();
if (direction === Meta.MotionDirection.DOWN) if (direction === Meta.MotionDirection.DOWN)
finalState = Math.max(finalState - 1, ControlsState.HIDDEN); finalState = Math.max(finalState - 1, ControlsState.HIDDEN);
@ -844,7 +844,7 @@ class ControlsManager extends St.Widget {
// We can't run the animation before the first allocation happens // We can't run the animation before the first allocation happens
await this.layout_manager.ensureAllocation(); await this.layout_manager.ensureAllocation();
const { STARTUP_ANIMATION_TIME } = Layout; const {STARTUP_ANIMATION_TIME} = Layout;
// Opacity // Opacity
this.ease({ this.ease({
@ -854,7 +854,7 @@ class ControlsManager extends St.Widget {
}); });
// Search bar falls from the ceiling // Search bar falls from the ceiling
const { primaryMonitor } = Main.layoutManager; const {primaryMonitor} = Main.layoutManager;
const [, y] = this._searchEntryBin.get_transformed_position(); const [, y] = this._searchEntryBin.get_transformed_position();
const yOffset = y - primaryMonitor.y; const yOffset = y - primaryMonitor.y;

View File

@ -25,7 +25,7 @@ const LTR = 0;
const RTL = 1; const RTL = 1;
const PadChooser = GObject.registerClass({ const PadChooser = GObject.registerClass({
Signals: { 'pad-selected': { param_types: [Clutter.InputDevice.$gtype] } }, Signals: {'pad-selected': {param_types: [Clutter.InputDevice.$gtype]}},
}, class PadChooser extends St.Button { }, class PadChooser extends St.Button {
_init(device, groupDevices) { _init(device, groupDevices) {
super._init({ super._init({
@ -94,7 +94,7 @@ const PadChooser = GObject.registerClass({
}); });
const KeybindingEntry = GObject.registerClass({ const KeybindingEntry = GObject.registerClass({
Signals: { 'keybinding-edited': { param_types: [GObject.TYPE_STRING] } }, Signals: {'keybinding-edited': {param_types: [GObject.TYPE_STRING]}},
}, class KeybindingEntry extends St.Entry { }, class KeybindingEntry extends St.Entry {
_init() { _init() {
super._init({hint_text: _('New shortcut…'), style: 'width: 10em'}); super._init({hint_text: _('New shortcut…'), style: 'width: 10em'});
@ -114,20 +114,20 @@ const KeybindingEntry = GObject.registerClass({
}); });
const ActionComboBox = GObject.registerClass({ const ActionComboBox = GObject.registerClass({
Signals: { 'action-selected': { param_types: [GObject.TYPE_INT] } }, Signals: {'action-selected': {param_types: [GObject.TYPE_INT]}},
}, class ActionComboBox extends St.Button { }, class ActionComboBox extends St.Button {
_init() { _init() {
super._init({ style_class: 'button' }); super._init({style_class: 'button'});
this.set_toggle_mode(true); this.set_toggle_mode(true);
const boxLayout = new Clutter.BoxLayout({ const boxLayout = new Clutter.BoxLayout({
orientation: Clutter.Orientation.HORIZONTAL, orientation: Clutter.Orientation.HORIZONTAL,
spacing: 6, spacing: 6,
}); });
let box = new St.Widget({ layout_manager: boxLayout }); let box = new St.Widget({layout_manager: boxLayout});
this.set_child(box); this.set_child(box);
this._label = new St.Label({ style_class: 'combo-box-label' }); this._label = new St.Label({style_class: 'combo-box-label'});
box.add_child(this._label); box.add_child(this._label);
const arrow = new St.Icon({ const arrow = new St.Icon({
@ -203,7 +203,7 @@ const ActionComboBox = GObject.registerClass({
}); });
const ActionEditor = GObject.registerClass({ const ActionEditor = GObject.registerClass({
Signals: { 'done': {} }, Signals: {'done': {}},
}, class ActionEditor extends St.Widget { }, class ActionEditor extends St.Widget {
_init() { _init() {
const boxLayout = new Clutter.BoxLayout({ const boxLayout = new Clutter.BoxLayout({
@ -211,7 +211,7 @@ const ActionEditor = GObject.registerClass({
spacing: 12, spacing: 12,
}); });
super._init({ layout_manager: boxLayout }); super._init({layout_manager: boxLayout});
this._actionComboBox = new ActionComboBox(); this._actionComboBox = new ActionComboBox();
this._actionComboBox.connect('action-selected', this._onActionSelected.bind(this)); this._actionComboBox.connect('action-selected', this._onActionSelected.bind(this));
@ -447,12 +447,12 @@ const PadDiagram = GObject.registerClass({
this._updateDiagramScale(); this._updateDiagramScale();
for (let i = 0; i < this._labels.length; i++) { for (let i = 0; i < this._labels.length; i++) {
const { label, x, y, arrangement } = this._labels[i]; const {label, x, y, arrangement} = this._labels[i];
this._allocateChild(label, x, y, arrangement); this._allocateChild(label, x, y, arrangement);
} }
if (this._editorActor && this._curEdited) { if (this._editorActor && this._curEdited) {
const { x, y, arrangement } = this._curEdited; const {x, y, arrangement} = this._curEdited;
this._allocateChild(this._editorActor, x, y, arrangement); this._allocateChild(this._editorActor, x, y, arrangement);
} }
} }
@ -567,14 +567,14 @@ const PadDiagram = GObject.registerClass({
return false; return false;
let label = new St.Label(); let label = new St.Label();
this._labels.push({ label, action, idx, dir, x, y, arrangement }); this._labels.push({label, action, idx, dir, x, y, arrangement});
this.add_actor(label); this.add_actor(label);
return true; return true;
} }
updateLabels(getText) { updateLabels(getText) {
for (let i = 0; i < this._labels.length; i++) { for (let i = 0; i < this._labels.length; i++) {
const { label, action, idx, dir } = this._labels[i]; const {label, action, idx, dir} = this._labels[i];
let str = getText(action, idx, dir); let str = getText(action, idx, dir);
label.set_text(str); label.set_text(str);
} }
@ -592,7 +592,7 @@ const PadDiagram = GObject.registerClass({
this._editorActor.hide(); this._editorActor.hide();
if (this._curEdited) { if (this._curEdited) {
const { label, action, idx, dir } = this._curEdited; const {label, action, idx, dir} = this._curEdited;
this._applyLabel(label, action, idx, dir, str); this._applyLabel(label, action, idx, dir, str);
this._curEdited = null; this._curEdited = null;
} }
@ -625,7 +625,7 @@ const PadDiagram = GObject.registerClass({
export const PadOsd = GObject.registerClass({ export const PadOsd = GObject.registerClass({
Signals: { Signals: {
'pad-selected': { param_types: [Clutter.InputDevice.$gtype] }, 'pad-selected': {param_types: [Clutter.InputDevice.$gtype]},
'closed': {}, 'closed': {},
}, },
}, class PadOsd extends St.BoxLayout { }, class PadOsd extends St.BoxLayout {
@ -677,7 +677,7 @@ export const PadOsd = GObject.registerClass({
Main.uiGroup.add_actor(this); Main.uiGroup.add_actor(this);
this._monitorIndex = monitorIndex; this._monitorIndex = monitorIndex;
let constraint = new Layout.MonitorConstraint({ index: monitorIndex }); let constraint = new Layout.MonitorConstraint({index: monitorIndex});
this.add_constraint(constraint); this.add_constraint(constraint);
this._titleBox = new St.BoxLayout({ this._titleBox = new St.BoxLayout({
@ -702,7 +702,7 @@ export const PadOsd = GObject.registerClass({
this._titleLabel.clutter_text.set_text(padDevice.get_device_name()); this._titleLabel.clutter_text.set_text(padDevice.get_device_name());
labelBox.add_actor(this._titleLabel); labelBox.add_actor(this._titleLabel);
this._tipLabel = new St.Label({ x_align: Clutter.ActorAlign.CENTER }); this._tipLabel = new St.Label({x_align: Clutter.ActorAlign.CENTER});
labelBox.add_actor(this._tipLabel); labelBox.add_actor(this._tipLabel);
this._updatePadChooser(); this._updatePadChooser();
@ -896,7 +896,7 @@ export const PadOsd = GObject.registerClass({
return; return;
this._endActionEdition(); this._endActionEdition();
this._editedAction = { type, number, dir, mode }; this._editedAction = {type, number, dir, mode};
const settingsPath = `${this._settings.path}${key}/`; const settingsPath = `${this._settings.path}${key}/`;
this._editedActionSettings = Gio.Settings.new_with_path('org.gnome.desktop.peripherals.tablet.pad-button', this._editedActionSettings = Gio.Settings.new_with_path('org.gnome.desktop.peripherals.tablet.pad-button',

View File

@ -11,7 +11,7 @@ const INDICATOR_INACTIVE_SCALE = 2 / 3;
const INDICATOR_INACTIVE_SCALE_PRESSED = 0.5; const INDICATOR_INACTIVE_SCALE_PRESSED = 0.5;
export const PageIndicators = GObject.registerClass({ export const PageIndicators = GObject.registerClass({
Signals: { 'page-activated': { param_types: [GObject.TYPE_INT] } }, Signals: {'page-activated': {param_types: [GObject.TYPE_INT]}},
}, class PageIndicators extends St.BoxLayout { }, class PageIndicators extends St.BoxLayout {
_init(orientation = Clutter.Orientation.VERTICAL) { _init(orientation = Clutter.Orientation.VERTICAL) {
let vertical = orientation == Clutter.Orientation.VERTICAL; let vertical = orientation == Clutter.Orientation.VERTICAL;
@ -65,7 +65,7 @@ export const PageIndicators = GObject.registerClass({
}); });
indicator.child = new St.Widget({ indicator.child = new St.Widget({
style_class: 'page-indicator-icon', style_class: 'page-indicator-icon',
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
}); });
indicator.connect('clicked', () => { indicator.connect('clicked', () => {
this.emit('page-activated', pageIndex); this.emit('page-activated', pageIndex);

View File

@ -68,13 +68,13 @@ const AppMenuButton = GObject.registerClass({
this._menuManager = panel.menuManager; this._menuManager = panel.menuManager;
this._targetApp = null; this._targetApp = null;
let bin = new St.Bin({ name: 'appMenu' }); let bin = new St.Bin({name: 'appMenu'});
this.add_actor(bin); this.add_actor(bin);
this.bind_property('reactive', this, 'can-focus', 0); this.bind_property('reactive', this, 'can-focus', 0);
this.reactive = false; this.reactive = false;
this._container = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); this._container = new St.BoxLayout({style_class: 'panel-status-menu-box'});
bin.set_child(this._container); bin.set_child(this._container);
let textureCache = St.TextureCache.get_default(); let textureCache = St.TextureCache.get_default();
@ -478,11 +478,11 @@ class Panel extends St.Widget {
this.menuManager = new PopupMenu.PopupMenuManager(this); this.menuManager = new PopupMenu.PopupMenuManager(this);
this._leftBox = new St.BoxLayout({ name: 'panelLeft' }); this._leftBox = new St.BoxLayout({name: 'panelLeft'});
this.add_child(this._leftBox); this.add_child(this._leftBox);
this._centerBox = new St.BoxLayout({ name: 'panelCenter' }); this._centerBox = new St.BoxLayout({name: 'panelCenter'});
this.add_child(this._centerBox); this.add_child(this._centerBox);
this._rightBox = new St.BoxLayout({ name: 'panelRight' }); this._rightBox = new St.BoxLayout({name: 'panelRight'});
this.add_child(this._rightBox); this.add_child(this._rightBox);
this.connect('button-press-event', this._onButtonPress.bind(this)); this.connect('button-press-event', this._onButtonPress.bind(this));
@ -497,7 +497,7 @@ class Panel extends St.Widget {
Main.layoutManager.panelBox.add(this); Main.layoutManager.panelBox.add(this);
Main.ctrlAltTabManager.addGroup(this, _('Top Bar'), 'focus-top-bar-symbolic', Main.ctrlAltTabManager.addGroup(this, _('Top Bar'), 'focus-top-bar-symbolic',
{ sortGroup: CtrlAltTab.SortGroup.TOP }); {sortGroup: CtrlAltTab.SortGroup.TOP});
Main.sessionMode.connect('updated', this._updatePanel.bind(this)); Main.sessionMode.connect('updated', this._updatePanel.bind(this));

View File

@ -22,7 +22,7 @@ class ButtonBox extends St.Widget {
this._delegate = this; this._delegate = this;
this.container = new St.Bin({ child: this }); this.container = new St.Bin({child: this});
this.connect('style-changed', this._onStyleChanged.bind(this)); this.connect('style-changed', this._onStyleChanged.bind(this));
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));
@ -95,7 +95,7 @@ class ButtonBox extends St.Widget {
}); });
export const Button = GObject.registerClass({ export const Button = GObject.registerClass({
Signals: { 'menu-set': {} }, Signals: {'menu-set': {}},
}, class PanelMenuButton extends ButtonBox { }, class PanelMenuButton extends ButtonBox {
_init(menuAlignment, nameText, dontCreateMenu) { _init(menuAlignment, nameText, dontCreateMenu) {
super._init({ super._init({
@ -216,7 +216,7 @@ class SystemIndicator extends St.BoxLayout {
get indicators() { get indicators() {
let klass = this.constructor.name; let klass = this.constructor.name;
let { stack } = new Error(); let {stack} = new Error();
log(`Usage of indicator.indicators is deprecated for ${klass}\n${stack}`); log(`Usage of indicator.indicators is deprecated for ${klass}\n${stack}`);
return this; return this;
} }
@ -226,7 +226,7 @@ class SystemIndicator extends St.BoxLayout {
} }
_addIndicator() { _addIndicator() {
let icon = new St.Icon({ style_class: 'system-status-icon' }); let icon = new St.Icon({style_class: 'system-status-icon'});
this.add_actor(icon); this.add_actor(icon);
icon.connect('notify::visible', this._syncIndicatorsVisible.bind(this)); icon.connect('notify::visible', this._syncIndicatorsVisible.bind(this));
this._syncIndicatorsVisible(); this._syncIndicatorsVisible();

View File

@ -73,7 +73,7 @@ export const PopupBaseMenuItem = GObject.registerClass({
true), true),
}, },
Signals: { Signals: {
'activate': { param_types: [Clutter.Event.$gtype] }, 'activate': {param_types: [Clutter.Event.$gtype]},
}, },
}, class PopupBaseMenuItem extends St.BoxLayout { }, class PopupBaseMenuItem extends St.BoxLayout {
_init(params) { _init(params) {
@ -291,7 +291,7 @@ class PopupSeparatorMenuItem extends PopupBaseMenuItem {
can_focus: false, can_focus: false,
}); });
this.label = new St.Label({ text: text || '' }); this.label = new St.Label({text: text || ''});
this.add(this.label); this.add(this.label);
this.label_actor = this.label; this.label_actor = this.label;
@ -354,7 +354,7 @@ export const Switch = GObject.registerClass({
}); });
export const PopupSwitchMenuItem = GObject.registerClass({ export const PopupSwitchMenuItem = GObject.registerClass({
Signals: { 'toggled': { param_types: [GObject.TYPE_BOOLEAN] } }, Signals: {'toggled': {param_types: [GObject.TYPE_BOOLEAN]}},
}, class PopupSwitchMenuItem extends PopupBaseMenuItem { }, class PopupSwitchMenuItem extends PopupBaseMenuItem {
_init(text, active, params) { _init(text, active, params) {
super._init(params); super._init(params);
@ -614,7 +614,7 @@ export class PopupMenuBase extends Signals.EventEmitter {
_connectItemSignals(menuItem) { _connectItemSignals(menuItem) {
menuItem.connectObject( menuItem.connectObject(
'notify::active', () => { 'notify::active', () => {
const { active } = menuItem; const {active} = menuItem;
if (active && this._activeMenuItem !== menuItem) { if (active && this._activeMenuItem !== menuItem) {
if (this._activeMenuItem) if (this._activeMenuItem)
this._activeMenuItem.active = false; this._activeMenuItem.active = false;
@ -626,7 +626,7 @@ export class PopupMenuBase extends Signals.EventEmitter {
} }
}, },
'notify::sensitive', () => { 'notify::sensitive', () => {
const { sensitive } = menuItem; const {sensitive} = menuItem;
if (!sensitive && this._activeMenuItem === menuItem) { if (!sensitive && this._activeMenuItem === menuItem) {
if (!this.actor.navigate_focus(menuItem.actor, if (!this.actor.navigate_focus(menuItem.actor,
St.DirectionType.TAB_FORWARD, true)) St.DirectionType.TAB_FORWARD, true))
@ -1168,7 +1168,7 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
this.add_style_class_name('popup-submenu-menu-item'); this.add_style_class_name('popup-submenu-menu-item');
if (wantIcon) { if (wantIcon) {
this.icon = new St.Icon({ style_class: 'popup-menu-icon' }); this.icon = new St.Icon({style_class: 'popup-menu-icon'});
this.add_child(this.icon); this.add_child(this.icon);
} }
@ -1187,7 +1187,7 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
this.add_child(expander); this.add_child(expander);
this._triangle = arrowIcon(St.Side.RIGHT); this._triangle = arrowIcon(St.Side.RIGHT);
this._triangle.pivot_point = new Graphene.Point({ x: 0.5, y: 0.6 }); this._triangle.pivot_point = new Graphene.Point({x: 0.5, y: 0.6});
this._triangleBin = new St.Widget({ this._triangleBin = new St.Widget({
y_expand: true, y_expand: true,
@ -1270,7 +1270,7 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
export class PopupMenuManager { export class PopupMenuManager {
constructor(owner, grabParams) { constructor(owner, grabParams) {
this._grabParams = Params.parse(grabParams, this._grabParams = Params.parse(grabParams,
{ actionMode: Shell.ActionMode.POPUP }); {actionMode: Shell.ActionMode.POPUP});
global.stage.connect('notify::key-focus', () => { global.stage.connect('notify::key-focus', () => {
if (!this.activeMenu) if (!this.activeMenu)
return; return;

View File

@ -237,7 +237,7 @@ class RemoteSearchProvider {
} }
if (gicon) if (gicon)
icon = new St.Icon({ gicon, icon_size: size }); icon = new St.Icon({gicon, icon_size: size});
return icon; return icon;
} }

View File

@ -32,8 +32,8 @@ class RunDialog extends ModalDialog.ModalDialog {
destroyOnClose: false, destroyOnClose: false,
}); });
this._lockdownSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA }); this._lockdownSettings = new Gio.Settings({schema_id: LOCKDOWN_SCHEMA});
this._terminalSettings = new Gio.Settings({ schema_id: TERMINAL_SCHEMA }); this._terminalSettings = new Gio.Settings({schema_id: TERMINAL_SCHEMA});
global.settings.connect('changed::development-tools', () => { global.settings.connect('changed::development-tools', () => {
this._enableInternalCommands = global.settings.get_boolean('development-tools'); this._enableInternalCommands = global.settings.get_boolean('development-tools');
}); });
@ -62,7 +62,7 @@ class RunDialog extends ModalDialog.ModalDialog {
let title = _('Run a Command'); let title = _('Run a Command');
let content = new Dialog.MessageDialogContent({ title }); let content = new Dialog.MessageDialogContent({title});
this.contentLayout.add_actor(content); this.contentLayout.add_actor(content);
let entry = new St.Entry({ let entry = new St.Entry({

View File

@ -70,7 +70,7 @@ export class ScreenShield extends Signals.EventEmitter {
y_expand: true, y_expand: true,
reactive: true, reactive: true,
can_focus: true, can_focus: true,
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
name: 'lockDialogGroup', name: 'lockDialogGroup',
}); });
@ -108,10 +108,10 @@ export class ScreenShield extends Signals.EventEmitter {
this._loginSession = null; this._loginSession = null;
this._getLoginSession(); this._getLoginSession();
this._settings = new Gio.Settings({ schema_id: SCREENSAVER_SCHEMA }); this._settings = new Gio.Settings({schema_id: SCREENSAVER_SCHEMA});
this._settings.connect(`changed::${LOCK_ENABLED_KEY}`, this._syncInhibitor.bind(this)); this._settings.connect(`changed::${LOCK_ENABLED_KEY}`, this._syncInhibitor.bind(this));
this._lockSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA }); this._lockSettings = new Gio.Settings({schema_id: LOCKDOWN_SCHEMA});
this._lockSettings.connect(`changed::${DISABLE_LOCK_KEY}`, this._syncInhibitor.bind(this)); this._lockSettings.connect(`changed::${DISABLE_LOCK_KEY}`, this._syncInhibitor.bind(this));
this._isModal = false; this._isModal = false;
@ -202,7 +202,7 @@ export class ScreenShield extends Signals.EventEmitter {
if (this._isModal) if (this._isModal)
return true; return true;
let grab = Main.pushModal(Main.uiGroup, { actionMode: Shell.ActionMode.LOCK_SCREEN }); let grab = Main.pushModal(Main.uiGroup, {actionMode: Shell.ActionMode.LOCK_SCREEN});
// We expect at least a keyboard grab here // We expect at least a keyboard grab here
this._isModal = (grab.get_seat_state() & Clutter.GrabState.KEYBOARD) !== 0; this._isModal = (grab.get_seat_state() & Clutter.GrabState.KEYBOARD) !== 0;
@ -478,12 +478,12 @@ export class ScreenShield extends Signals.EventEmitter {
duration: Overview.ANIMATION_TIME, duration: Overview.ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD, mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => { onComplete: () => {
this._lockScreenShown({ fadeToBlack, animateFade: true }); this._lockScreenShown({fadeToBlack, animateFade: true});
}, },
}); });
} else { } else {
this._lockDialogGroup.translation_y = 0; this._lockDialogGroup.translation_y = 0;
this._lockScreenShown({ fadeToBlack, animateFade: false }); this._lockScreenShown({fadeToBlack, animateFade: false});
} }
this._dialog.grab_key_focus(); this._dialog.grab_key_focus();

View File

@ -124,7 +124,7 @@ class UIAreaIndicator extends St.Widget {
_init(params) { _init(params) {
super._init(params); super._init(params);
this._topRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' }); this._topRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._topRect.add_constraint(new Clutter.BindConstraint({ this._topRect.add_constraint(new Clutter.BindConstraint({
source: this, source: this,
coordinate: Clutter.BindCoordinate.WIDTH, coordinate: Clutter.BindCoordinate.WIDTH,
@ -141,7 +141,7 @@ class UIAreaIndicator extends St.Widget {
})); }));
this.add_child(this._topRect); this.add_child(this._topRect);
this._bottomRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' }); this._bottomRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._bottomRect.add_constraint(new Clutter.BindConstraint({ this._bottomRect.add_constraint(new Clutter.BindConstraint({
source: this, source: this,
coordinate: Clutter.BindCoordinate.WIDTH, coordinate: Clutter.BindCoordinate.WIDTH,
@ -158,7 +158,7 @@ class UIAreaIndicator extends St.Widget {
})); }));
this.add_child(this._bottomRect); this.add_child(this._bottomRect);
this._leftRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' }); this._leftRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._leftRect.add_constraint(new Clutter.SnapConstraint({ this._leftRect.add_constraint(new Clutter.SnapConstraint({
source: this, source: this,
from_edge: Clutter.SnapEdge.LEFT, from_edge: Clutter.SnapEdge.LEFT,
@ -176,7 +176,7 @@ class UIAreaIndicator extends St.Widget {
})); }));
this.add_child(this._leftRect); this.add_child(this._leftRect);
this._rightRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-shade' }); this._rightRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-shade'});
this._rightRect.add_constraint(new Clutter.SnapConstraint({ this._rightRect.add_constraint(new Clutter.SnapConstraint({
source: this, source: this,
from_edge: Clutter.SnapEdge.RIGHT, from_edge: Clutter.SnapEdge.RIGHT,
@ -194,7 +194,7 @@ class UIAreaIndicator extends St.Widget {
})); }));
this.add_child(this._rightRect); this.add_child(this._rightRect);
this._selectionRect = new St.Widget({ style_class: 'screenshot-ui-area-indicator-selection' }); this._selectionRect = new St.Widget({style_class: 'screenshot-ui-area-indicator-selection'});
this.add_child(this._selectionRect); this.add_child(this._selectionRect);
this._topRect.add_constraint(new Clutter.SnapConstraint({ this._topRect.add_constraint(new Clutter.SnapConstraint({
@ -229,7 +229,7 @@ class UIAreaIndicator extends St.Widget {
}); });
const UIAreaSelector = GObject.registerClass({ const UIAreaSelector = GObject.registerClass({
Signals: { 'drag-started': {}, 'drag-ended': {} }, Signals: {'drag-started': {}, 'drag-ended': {}},
}, class UIAreaSelector extends St.Widget { }, class UIAreaSelector extends St.Widget {
_init(params) { _init(params) {
super._init(params); super._init(params);
@ -247,13 +247,13 @@ const UIAreaSelector = GObject.registerClass({
})); }));
this.add_child(this._areaIndicator); this.add_child(this._areaIndicator);
this._topLeftHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' }); this._topLeftHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._topLeftHandle); this.add_child(this._topLeftHandle);
this._topRightHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' }); this._topRightHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._topRightHandle); this.add_child(this._topRightHandle);
this._bottomLeftHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' }); this._bottomLeftHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._bottomLeftHandle); this.add_child(this._bottomLeftHandle);
this._bottomRightHandle = new St.Widget({ style_class: 'screenshot-ui-area-selector-handle' }); this._bottomRightHandle = new St.Widget({style_class: 'screenshot-ui-area-selector-handle'});
this.add_child(this._bottomRightHandle); this.add_child(this._bottomRightHandle);
// This will be updated before the first drawn frame. // This will be updated before the first drawn frame.
@ -784,7 +784,7 @@ class UIWindowSelectorWindow extends St.Button {
}); });
this.add_child(this._actor); this.add_child(this._actor);
this._border = new St.Bin({ style_class: 'screenshot-ui-window-selector-window-border' }); this._border = new St.Bin({style_class: 'screenshot-ui-window-selector-window-border'});
this._border.connect('style-changed', () => { this._border.connect('style-changed', () => {
this._borderSize = this._borderSize =
this._border.get_theme_node().get_border_width(St.Side.TOP); this._border.get_theme_node().get_border_width(St.Side.TOP);
@ -799,7 +799,7 @@ class UIWindowSelectorWindow extends St.Button {
}); });
this._cursor = null; this._cursor = null;
this._cursorPoint = { x: 0, y: 0 }; this._cursorPoint = {x: 0, y: 0};
this._shouldShowCursor = window.has_pointer && window.has_pointer(); this._shouldShowCursor = window.has_pointer && window.has_pointer();
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));
@ -1063,11 +1063,11 @@ export const ScreenshotUI = GObject.registerClass({
this._screencastFailed(); this._screencastFailed();
}); });
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); this._lockdownSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
// The full-screen screenshot has a separate container so that we can // The full-screen screenshot has a separate container so that we can
// show it without the screenshot UI fade-in for a nicer animation. // show it without the screenshot UI fade-in for a nicer animation.
this._stageScreenshotContainer = new St.Widget({ visible: false }); this._stageScreenshotContainer = new St.Widget({visible: false});
this._stageScreenshotContainer.add_constraint(new Clutter.BindConstraint({ this._stageScreenshotContainer.add_constraint(new Clutter.BindConstraint({
source: global.stage, source: global.stage,
coordinate: Clutter.BindCoordinate.ALL, coordinate: Clutter.BindCoordinate.ALL,
@ -1094,7 +1094,7 @@ export const ScreenshotUI = GObject.registerClass({
Main.layoutManager.screenshotUIGroup.add_child(this); Main.layoutManager.screenshotUIGroup.add_child(this);
this._stageScreenshot = new St.Widget({ style_class: 'screenshot-ui-screen-screenshot' }); this._stageScreenshot = new St.Widget({style_class: 'screenshot-ui-screen-screenshot'});
this._stageScreenshot.add_constraint(new Clutter.BindConstraint({ this._stageScreenshot.add_constraint(new Clutter.BindConstraint({
source: global.stage, source: global.stage,
coordinate: Clutter.BindCoordinate.ALL, coordinate: Clutter.BindCoordinate.ALL,
@ -1117,9 +1117,9 @@ export const ScreenshotUI = GObject.registerClass({
}); });
this.add_child(this._areaSelector); this.add_child(this._areaSelector);
this._primaryMonitorBin = new St.Widget({ layout_manager: new Clutter.BinLayout() }); this._primaryMonitorBin = new St.Widget({layout_manager: new Clutter.BinLayout()});
this._primaryMonitorBin.add_constraint( this._primaryMonitorBin.add_constraint(
new Layout.MonitorConstraint({ 'primary': true })); new Layout.MonitorConstraint({'primary': true}));
this.add_child(this._primaryMonitorBin); this.add_child(this._primaryMonitorBin);
this._panel = new St.BoxLayout({ this._panel = new St.BoxLayout({
@ -1142,13 +1142,13 @@ export const ScreenshotUI = GObject.registerClass({
this._closeButton.add_constraint(new Clutter.AlignConstraint({ this._closeButton.add_constraint(new Clutter.AlignConstraint({
source: this._panel, source: this._panel,
align_axis: Clutter.AlignAxis.Y_AXIS, align_axis: Clutter.AlignAxis.Y_AXIS,
pivot_point: new Graphene.Point({ x: -1, y: 0.5 }), pivot_point: new Graphene.Point({x: -1, y: 0.5}),
factor: 0, factor: 0,
})); }));
this._closeButtonXAlignConstraint = new Clutter.AlignConstraint({ this._closeButtonXAlignConstraint = new Clutter.AlignConstraint({
source: this._panel, source: this._panel,
align_axis: Clutter.AlignAxis.X_AXIS, align_axis: Clutter.AlignAxis.X_AXIS,
pivot_point: new Graphene.Point({ x: 0.5, y: -1 }), pivot_point: new Graphene.Point({x: 0.5, y: -1}),
}); });
this._closeButton.add_constraint(this._closeButtonXAlignConstraint); this._closeButton.add_constraint(this._closeButtonXAlignConstraint);
this._closeButton.connect('clicked', () => this.close()); this._closeButton.connect('clicked', () => this.close());
@ -1233,7 +1233,7 @@ export const ScreenshotUI = GObject.registerClass({
visible: false, visible: false,
})); }));
this._bottomRowContainer = new St.Widget({ layout_manager: new Clutter.BinLayout() }); this._bottomRowContainer = new St.Widget({layout_manager: new Clutter.BinLayout()});
this._panel.add_child(this._bottomRowContainer); this._panel.add_child(this._bottomRowContainer);
this._shotCastContainer = new St.BoxLayout({ this._shotCastContainer = new St.BoxLayout({
@ -1340,7 +1340,7 @@ export const ScreenshotUI = GObject.registerClass({
Main.wm.addKeybinding( Main.wm.addKeybinding(
'show-screenshot-ui', 'show-screenshot-ui',
new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }), new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
uiModes, uiModes,
showScreenshotUI showScreenshotUI
@ -1348,7 +1348,7 @@ export const ScreenshotUI = GObject.registerClass({
Main.wm.addKeybinding( Main.wm.addKeybinding(
'show-screen-recording-ui', 'show-screen-recording-ui',
new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }), new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
restrictedModes, restrictedModes,
showScreenRecordingUI showScreenRecordingUI
@ -1356,7 +1356,7 @@ export const ScreenshotUI = GObject.registerClass({
Main.wm.addKeybinding( Main.wm.addKeybinding(
'screenshot-window', 'screenshot-window',
new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }), new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT | Meta.KeyBindingFlags.PER_WINDOW, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT | Meta.KeyBindingFlags.PER_WINDOW,
restrictedModes, restrictedModes,
async (_display, window, _binding) => { async (_display, window, _binding) => {
@ -1374,7 +1374,7 @@ export const ScreenshotUI = GObject.registerClass({
Main.wm.addKeybinding( Main.wm.addKeybinding(
'screenshot', 'screenshot',
new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }), new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
uiModes, uiModes,
async () => { async () => {
@ -1427,7 +1427,7 @@ export const ScreenshotUI = GObject.registerClass({
const bin = new St.Widget({ const bin = new St.Widget({
layout_manager: new Clutter.BinLayout(), layout_manager: new Clutter.BinLayout(),
}); });
bin.add_constraint(new Layout.MonitorConstraint({ 'index': i })); bin.add_constraint(new Layout.MonitorConstraint({'index': i}));
this.insert_child_below(bin, this._primaryMonitorBin); this.insert_child_below(bin, this._primaryMonitorBin);
this._monitorBins.push(bin); this._monitorBins.push(bin);
@ -1563,7 +1563,7 @@ export const ScreenshotUI = GObject.registerClass({
// pop their grabs. // pop their grabs.
Main.layoutManager.emit('system-modal-opened'); Main.layoutManager.emit('system-modal-opened');
const { screenshotUIGroup } = Main.layoutManager; const {screenshotUIGroup} = Main.layoutManager;
screenshotUIGroup.get_parent().set_child_above_sibling( screenshotUIGroup.get_parent().set_child_above_sibling(
screenshotUIGroup, null); screenshotUIGroup, null);
@ -2130,7 +2130,7 @@ function _storeScreenshot(bytes, pixbuf) {
} }
const lockdownSettings = const lockdownSettings =
new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
const disableSaveToDisk = const disableSaveToDisk =
lockdownSettings.get_boolean('disable-save-to-disk'); lockdownSettings.get_boolean('disable-save-to-disk');
@ -2200,7 +2200,7 @@ function _storeScreenshot(bytes, pixbuf) {
_('Screenshot captured'), _('Screenshot captured'),
// Translators: notification body when a screenshot was captured. // Translators: notification body when a screenshot was captured.
_('You can paste the image from the clipboard.'), _('You can paste the image from the clipboard.'),
{ datetime: time, gicon: content } {datetime: time, gicon: content}
); );
if (!disableSaveToDisk) { if (!disableSaveToDisk) {
@ -2249,7 +2249,7 @@ async function captureScreenshot(texture, geometry, scale, cursor) {
const stream = Gio.MemoryOutputStream.new_resizable(); const stream = Gio.MemoryOutputStream.new_resizable();
const [x, y, w, h] = geometry ?? [0, 0, -1, -1]; const [x, y, w, h] = geometry ?? [0, 0, -1, -1];
if (cursor === null) if (cursor === null)
cursor = { texture: null, x: 0, y: 0, scale: 1 }; cursor = {texture: null, x: 0, y: 0, scale: 1};
global.display.get_sound_player().play_from_theme( global.display.get_sound_player().play_from_theme(
'screen-capture', _('Screenshot taken'), null); 'screen-capture', _('Screenshot taken'), null);
@ -2297,7 +2297,7 @@ export class ScreenshotService {
'org.gnome.Screenshot', 'org.gnome.Screenshot',
]); ]);
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); this._lockdownSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null); Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null);
} }
@ -2570,7 +2570,7 @@ export class ScreenshotService {
'Invalid params'); 'Invalid params');
return; return;
} }
let flashspot = new Flashspot({ x, y, width, height }); let flashspot = new Flashspot({x, y, width, height});
flashspot.fire(); flashspot.fire();
invocation.return_value(null); invocation.return_value(null);
} }
@ -2583,7 +2583,7 @@ export class ScreenshotService {
const pickPixel = new PickPixel(screenshot); const pickPixel = new PickPixel(screenshot);
try { try {
const color = await pickPixel.pickAsync(); const color = await pickPixel.pickAsync();
const { red, green, blue } = color; const {red, green, blue} = color;
const retval = GLib.Variant.new('(a{sv})', [{ const retval = GLib.Variant.new('(a{sv})', [{
color: GLib.Variant.new('(ddd)', [ color: GLib.Variant.new('(ddd)', [
red / 255.0, red / 255.0,
@ -2640,7 +2640,7 @@ class SelectArea extends St.Widget {
this.show(); this.show();
try { try {
await this._grabHelper.grabAsync({ actor: this }); await this._grabHelper.grabAsync({actor: this});
} finally { } finally {
global.display.set_cursor(Meta.Cursor.DEFAULT); global.display.set_cursor(Meta.Cursor.DEFAULT);
@ -2837,7 +2837,7 @@ const RecolorEffect = GObject.registerClass({
export const PickPixel = GObject.registerClass( export const PickPixel = GObject.registerClass(
class PickPixel extends St.Widget { class PickPixel extends St.Widget {
_init(screenshot) { _init(screenshot) {
super._init({ visible: false, reactive: true }); super._init({visible: false, reactive: true});
this._screenshot = screenshot; this._screenshot = screenshot;
@ -2889,7 +2889,7 @@ class PickPixel extends St.Widget {
this._pickColor(...global.get_pointer()); this._pickColor(...global.get_pointer());
try { try {
await this._grabHelper.grabAsync({ actor: this }); await this._grabHelper.grabAsync({actor: this});
} finally { } finally {
global.display.set_cursor(Meta.Cursor.DEFAULT); global.display.set_cursor(Meta.Cursor.DEFAULT);
this._previewCursor.destroy(); this._previewCursor.destroy();
@ -2941,7 +2941,7 @@ class Flashspot extends Lightbox.Lightbox {
} }
fire(doneCallback) { fire(doneCallback) {
this.set({ visible: true, opacity: 255 }); this.set({visible: true, opacity: 255});
this.ease({ this.ease({
opacity: 0, opacity: 0,
duration: FLASHSPOT_ANIMATION_OUT_TIME, duration: FLASHSPOT_ANIMATION_OUT_TIME,

View File

@ -136,7 +136,7 @@ class GridSearchResult extends SearchResult {
this.style_class = 'grid-search-result'; this.style_class = 'grid-search-result';
this.icon = new IconGrid.BaseIcon(this.metaInfo['name'], this.icon = new IconGrid.BaseIcon(this.metaInfo['name'],
{ createIcon: this.metaInfo['createIcon'] }); {createIcon: this.metaInfo['createIcon']});
let content = new St.Bin({ let content = new St.Bin({
child: this.icon, child: this.icon,
x_align: Clutter.ActorAlign.START, x_align: Clutter.ActorAlign.START,
@ -158,7 +158,7 @@ const SearchResultsBase = GObject.registerClass({
}, },
}, class SearchResultsBase extends St.BoxLayout { }, class SearchResultsBase extends St.BoxLayout {
_init(provider, resultsView) { _init(provider, resultsView) {
super._init({ style_class: 'search-section', vertical: true }); super._init({style_class: 'search-section', vertical: true});
this.provider = provider; this.provider = provider;
this._resultsView = resultsView; this._resultsView = resultsView;
@ -169,7 +169,7 @@ const SearchResultsBase = GObject.registerClass({
this._resultDisplayBin = new St.Bin(); this._resultDisplayBin = new St.Bin();
this.add_child(this._resultDisplayBin); this.add_child(this._resultDisplayBin);
let separator = new St.Widget({ style_class: 'search-section-separator' }); let separator = new St.Widget({style_class: 'search-section-separator'});
this.add(separator); this.add(separator);
this._resultDisplays = {}; this._resultDisplays = {};
@ -285,7 +285,7 @@ class ListSearchResults extends SearchResultsBase {
_init(provider, resultsView) { _init(provider, resultsView) {
super._init(provider, resultsView); super._init(provider, resultsView);
this._container = new St.BoxLayout({ style_class: 'search-section-content' }); this._container = new St.BoxLayout({style_class: 'search-section-content'});
this.providerInfo = new ProviderInfo(provider); this.providerInfo = new ProviderInfo(provider);
this.providerInfo.connect('key-focus-in', this._keyFocusIn.bind(this)); this.providerInfo.connect('key-focus-in', this._keyFocusIn.bind(this));
this.providerInfo.connect('clicked', () => { this.providerInfo.connect('clicked', () => {
@ -459,7 +459,7 @@ class GridSearchResults extends SearchResultsBase {
_init(provider, resultsView) { _init(provider, resultsView) {
super._init(provider, resultsView); super._init(provider, resultsView);
this._grid = new St.Widget({ style_class: 'grid-search-results' }); this._grid = new St.Widget({style_class: 'grid-search-results'});
this._grid.layout_manager = new GridSearchResultsLayout(); this._grid.layout_manager = new GridSearchResultsLayout();
this._grid.connect('style-changed', () => { this._grid.connect('style-changed', () => {
@ -567,7 +567,7 @@ export const SearchResultsView = GObject.registerClass({
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC); this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
this._scrollView.add_actor(this._content); this._scrollView.add_actor(this._content);
let action = new Clutter.PanAction({ interpolate: true }); let action = new Clutter.PanAction({interpolate: true});
action.connect('pan', this._onPan.bind(this)); action.connect('pan', this._onPan.bind(this));
this._scrollView.add_action(action); this._scrollView.add_action(action);
@ -578,7 +578,7 @@ export const SearchResultsView = GObject.registerClass({
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER,
}); });
this._statusBin = new St.Bin({ y_expand: true }); this._statusBin = new St.Bin({y_expand: true});
this.add_child(this._statusBin); this.add_child(this._statusBin);
this._statusBin.add_actor(this._statusText); this._statusBin.add_actor(this._statusText);
@ -593,7 +593,7 @@ export const SearchResultsView = GObject.registerClass({
this._highlighter = new Highlighter(); this._highlighter = new Highlighter();
this._searchSettings = new Gio.Settings({ schema_id: SEARCH_PROVIDERS_SCHEMA }); this._searchSettings = new Gio.Settings({schema_id: SEARCH_PROVIDERS_SCHEMA});
this._searchSettings.connect('changed::disabled', this._reloadRemoteProviders.bind(this)); this._searchSettings.connect('changed::disabled', this._reloadRemoteProviders.bind(this));
this._searchSettings.connect('changed::enabled', this._reloadRemoteProviders.bind(this)); this._searchSettings.connect('changed::enabled', this._reloadRemoteProviders.bind(this));
this._searchSettings.connect('changed::disable-external', this._reloadRemoteProviders.bind(this)); this._searchSettings.connect('changed::disable-external', this._reloadRemoteProviders.bind(this));
@ -925,7 +925,7 @@ class ProviderInfo extends St.Button {
x_align: Clutter.ActorAlign.START, x_align: Clutter.ActorAlign.START,
}); });
this._moreLabel = new St.Label({ x_align: Clutter.ActorAlign.START }); this._moreLabel = new St.Label({x_align: Clutter.ActorAlign.START});
detailsBox.add_actor(nameLabel); detailsBox.add_actor(nameLabel);
detailsBox.add_actor(this._moreLabel); detailsBox.add_actor(this._moreLabel);

View File

@ -91,7 +91,7 @@ export const SearchController = GObject.registerClass({
// Since the entry isn't inside the results container we install this // Since the entry isn't inside the results container we install this
// dummy widget as the last results container child so that we can // dummy widget as the last results container child so that we can
// include the entry in the keynav tab path // include the entry in the keynav tab path
this._focusTrap = new FocusTrap({ can_focus: true }); this._focusTrap = new FocusTrap({can_focus: true});
this._focusTrap.connect('key-focus-in', () => { this._focusTrap.connect('key-focus-in', () => {
this._entry.grab_key_focus(); this._entry.grab_key_focus();
}); });

View File

@ -138,11 +138,11 @@ export function addContextMenu(entry, params) {
if (entry.menu) if (entry.menu)
return; return;
params = Params.parse(params, { actionMode: Shell.ActionMode.POPUP }); params = Params.parse(params, {actionMode: Shell.ActionMode.POPUP});
entry.menu = new EntryMenu(entry); entry.menu = new EntryMenu(entry);
entry._menuManager = new PopupMenu.PopupMenuManager(entry, entry._menuManager = new PopupMenu.PopupMenuManager(entry,
{ actionMode: params.actionMode }); {actionMode: params.actionMode});
entry._menuManager.addMenu(entry.menu); entry._menuManager.addMenu(entry.menu);
// Add an event handler to both the entry and its clutter_text; the former // Add an event handler to both the entry and its clutter_text; the former
@ -167,7 +167,7 @@ export function addContextMenu(entry, params) {
export const CapsLockWarning = GObject.registerClass( export const CapsLockWarning = GObject.registerClass(
class CapsLockWarning extends St.Label { class CapsLockWarning extends St.Label {
_init(params) { _init(params) {
let defaultParams = { style_class: 'caps-lock-warning-label' }; let defaultParams = {style_class: 'caps-lock-warning-label'};
super._init(Object.assign(defaultParams, params)); super._init(Object.assign(defaultParams, params));
this.text = _('Caps lock is on.'); this.text = _('Caps lock is on.');
@ -195,7 +195,7 @@ class CapsLockWarning extends St.Label {
this.remove_all_transitions(); this.remove_all_transitions();
const { naturalHeightSet } = this; const {naturalHeightSet} = this;
this.natural_height_set = false; this.natural_height_set = false;
let [, height] = this.get_preferred_height(-1); let [, height] = this.get_preferred_height(-1);
this.natural_height_set = naturalHeightSet; this.natural_height_set = naturalHeightSet;

View File

@ -56,7 +56,7 @@ function _setLabelsForMessage(content, message) {
export class ShellMountOperation { export class ShellMountOperation {
constructor(source, params) { constructor(source, params) {
params = Params.parse(params, { existingDialog: null }); params = Params.parse(params, {existingDialog: null});
this._dialog = null; this._dialog = null;
this._existingDialog = params.existingDialog; this._existingDialog = params.existingDialog;
@ -226,10 +226,10 @@ class ShellUnmountNotifier extends MessageTray.Source {
}); });
const ShellMountQuestionDialog = GObject.registerClass({ const ShellMountQuestionDialog = GObject.registerClass({
Signals: { 'response': { param_types: [GObject.TYPE_INT] } }, Signals: {'response': {param_types: [GObject.TYPE_INT]}},
}, class ShellMountQuestionDialog extends ModalDialog.ModalDialog { }, class ShellMountQuestionDialog extends ModalDialog.ModalDialog {
_init() { _init() {
super._init({ styleClass: 'mount-question-dialog' }); super._init({styleClass: 'mount-question-dialog'});
this._oldChoices = []; this._oldChoices = [];
@ -271,13 +271,13 @@ const ShellMountPasswordDialog = GObject.registerClass({
let strings = message.split('\n'); let strings = message.split('\n');
let title = strings.shift() || null; let title = strings.shift() || null;
let description = strings.shift() || null; let description = strings.shift() || null;
super._init({ styleClass: 'prompt-dialog' }); super._init({styleClass: 'prompt-dialog'});
let disksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop'); let disksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop');
let content = new Dialog.MessageDialogContent({ title, description }); let content = new Dialog.MessageDialogContent({title, description});
let passwordGridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL }); let passwordGridLayout = new Clutter.GridLayout({orientation: Clutter.Orientation.VERTICAL});
let passwordGrid = new St.Widget({ let passwordGrid = new St.Widget({
style_class: 'prompt-dialog-password-grid', style_class: 'prompt-dialog-password-grid',
layout_manager: passwordGridLayout, layout_manager: passwordGridLayout,
@ -355,7 +355,7 @@ const ShellMountPasswordDialog = GObject.registerClass({
} }
curGridRow += 1; curGridRow += 1;
let warningBox = new St.BoxLayout({ vertical: true }); let warningBox = new St.BoxLayout({vertical: true});
let capsLockWarning = new ShellEntry.CapsLockWarning(); let capsLockWarning = new ShellEntry.CapsLockWarning();
warningBox.add_child(capsLockWarning); warningBox.add_child(capsLockWarning);
@ -475,10 +475,10 @@ const ShellMountPasswordDialog = GObject.registerClass({
}); });
const ShellProcessesDialog = GObject.registerClass({ const ShellProcessesDialog = GObject.registerClass({
Signals: { 'response': { param_types: [GObject.TYPE_INT] } }, Signals: {'response': {param_types: [GObject.TYPE_INT]}},
}, class ShellProcessesDialog extends ModalDialog.ModalDialog { }, class ShellProcessesDialog extends ModalDialog.ModalDialog {
_init() { _init() {
super._init({ styleClass: 'processes-dialog' }); super._init({styleClass: 'processes-dialog'});
this._oldChoices = []; this._oldChoices = [];

View File

@ -40,7 +40,7 @@ class ATIndicator extends PanelMenu.Button {
icon_name: 'org.gnome.Settings-accessibility-symbolic', icon_name: 'org.gnome.Settings-accessibility-symbolic',
})); }));
this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA }); this._a11ySettings = new Gio.Settings({schema_id: A11Y_SCHEMA});
this._a11ySettings.connect(`changed::${KEY_ALWAYS_SHOW}`, this._queueSyncMenuVisibility.bind(this)); this._a11ySettings.connect(`changed::${KEY_ALWAYS_SHOW}`, this._queueSyncMenuVisibility.bind(this));
let highContrast = this._buildItem(_('High Contrast'), A11Y_INTERFACE_SCHEMA, KEY_HIGH_CONTRAST); let highContrast = this._buildItem(_('High Contrast'), A11Y_INTERFACE_SCHEMA, KEY_HIGH_CONTRAST);
@ -115,7 +115,7 @@ class ATIndicator extends PanelMenu.Button {
} }
_buildItem(string, schema, key) { _buildItem(string, schema, key) {
let settings = new Gio.Settings({ schema_id: schema }); let settings = new Gio.Settings({schema_id: schema});
let widget = this._buildItemExtended(string, let widget = this._buildItemExtended(string,
settings.get_boolean(key), settings.get_boolean(key),
settings.is_writable(key), settings.is_writable(key),
@ -131,7 +131,7 @@ class ATIndicator extends PanelMenu.Button {
} }
_buildFontItem() { _buildFontItem() {
let settings = new Gio.Settings({ schema_id: DESKTOP_INTERFACE_SCHEMA }); let settings = new Gio.Settings({schema_id: DESKTOP_INTERFACE_SCHEMA});
let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR); let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
let initialSetting = factor > 1.0; let initialSetting = factor > 1.0;
let widget = this._buildItemExtended(_('Large Text'), let widget = this._buildItemExtended(_('Large Text'),

View File

@ -44,7 +44,7 @@ class DwellClickIndicator extends PanelMenu.Button {
}); });
this.add_child(this._icon); this.add_child(this._icon);
this._a11ySettings = new Gio.Settings({ schema_id: MOUSE_A11Y_SCHEMA }); this._a11ySettings = new Gio.Settings({schema_id: MOUSE_A11Y_SCHEMA});
this._a11ySettings.connect(`changed::${KEY_DWELL_CLICK_ENABLED}`, this._syncMenuVisibility.bind(this)); this._a11ySettings.connect(`changed::${KEY_DWELL_CLICK_ENABLED}`, this._syncMenuVisibility.bind(this));
this._a11ySettings.connect(`changed::${KEY_DWELL_MODE}`, this._syncMenuVisibility.bind(this)); this._a11ySettings.connect(`changed::${KEY_DWELL_MODE}`, this._syncMenuVisibility.bind(this));

View File

@ -33,7 +33,7 @@ class LayoutMenuItem extends PopupMenu.PopupBaseMenuItem {
text: displayName, text: displayName,
x_expand: true, x_expand: true,
}); });
this.indicator = new St.Label({ text: shortName }); this.indicator = new St.Label({text: shortName});
this.add_child(this.label); this.add_child(this.label);
this.add(this.indicator); this.add(this.indicator);
this.label_actor = this.label; this.label_actor = this.label;
@ -123,9 +123,9 @@ class InputSourceSwitcher extends SwitcherPopup.SwitcherList {
} }
_addIcon(item) { _addIcon(item) {
let box = new St.BoxLayout({ vertical: true }); let box = new St.BoxLayout({vertical: true});
let bin = new St.Bin({ style_class: 'input-source-switcher-symbol' }); let bin = new St.Bin({style_class: 'input-source-switcher-symbol'});
let symbol = new St.Label({ let symbol = new St.Label({
text: item.shortName, text: item.shortName,
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,
@ -250,7 +250,7 @@ class InputSourceSystemSettings extends InputSourceSettings {
let id = layouts[i]; let id = layouts[i];
if (variants[i]) if (variants[i])
id += `+${variants[i]}`; id += `+${variants[i]}`;
sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id }); sourcesList.push({type: INPUT_SOURCE_TYPE_XKB, id});
} }
return sourcesList; return sourcesList;
} }
@ -270,7 +270,7 @@ class InputSourceSessionSettings extends InputSourceSettings {
this._KEY_KEYBOARD_OPTIONS = 'xkb-options'; this._KEY_KEYBOARD_OPTIONS = 'xkb-options';
this._KEY_PER_WINDOW = 'per-window'; this._KEY_PER_WINDOW = 'per-window';
this._settings = new Gio.Settings({ schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA }); this._settings = new Gio.Settings({schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA});
this._settings.connect(`changed::${this._KEY_INPUT_SOURCES}`, this._emitInputSourcesChanged.bind(this)); this._settings.connect(`changed::${this._KEY_INPUT_SOURCES}`, this._emitInputSourcesChanged.bind(this));
this._settings.connect(`changed::${this._KEY_KEYBOARD_OPTIONS}`, this._emitKeyboardOptionsChanged.bind(this)); this._settings.connect(`changed::${this._KEY_KEYBOARD_OPTIONS}`, this._emitKeyboardOptionsChanged.bind(this));
this._settings.connect(`changed::${this._KEY_PER_WINDOW}`, this._emitPerWindowChanged.bind(this)); this._settings.connect(`changed::${this._KEY_PER_WINDOW}`, this._emitPerWindowChanged.bind(this));
@ -283,7 +283,7 @@ class InputSourceSessionSettings extends InputSourceSettings {
for (let i = 0; i < nSources; i++) { for (let i = 0; i < nSources; i++) {
let [type, id] = sources.get_child_value(i).deepUnpack(); let [type, id] = sources.get_child_value(i).deepUnpack();
sourcesList.push({ type, id }); sourcesList.push({type, id});
} }
return sourcesList; return sourcesList;
} }
@ -330,13 +330,13 @@ export class InputSourceManager extends Signals.EventEmitter {
this._mruSourcesBackup = null; this._mruSourcesBackup = null;
this._keybindingAction = this._keybindingAction =
Main.wm.addKeybinding('switch-input-source', Main.wm.addKeybinding('switch-input-source',
new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.keybindings' }), new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}),
Meta.KeyBindingFlags.NONE, Meta.KeyBindingFlags.NONE,
Shell.ActionMode.ALL, Shell.ActionMode.ALL,
this._switchInputSource.bind(this)); this._switchInputSource.bind(this));
this._keybindingActionBackward = this._keybindingActionBackward =
Main.wm.addKeybinding('switch-input-source-backward', Main.wm.addKeybinding('switch-input-source-backward',
new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.keybindings' }), new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}),
Meta.KeyBindingFlags.IS_REVERSED, Meta.KeyBindingFlags.IS_REVERSED,
Shell.ActionMode.ALL, Shell.ActionMode.ALL,
this._switchInputSource.bind(this)); this._switchInputSource.bind(this));
@ -588,14 +588,14 @@ export class InputSourceManager extends Signals.EventEmitter {
} }
if (exists) if (exists)
infosList.push({ type, id, displayName, shortName }); infosList.push({type, id, displayName, shortName});
} }
if (infosList.length == 0) { if (infosList.length == 0) {
let type = INPUT_SOURCE_TYPE_XKB; let type = INPUT_SOURCE_TYPE_XKB;
let id = KeyboardManager.DEFAULT_LAYOUT; let id = KeyboardManager.DEFAULT_LAYOUT;
let [, displayName, shortName] = this._xkbInfo.get_layout_info(id); let [, displayName, shortName] = this._xkbInfo.get_layout_info(id);
infosList.push({ type, id, displayName, shortName }); infosList.push({type, id, displayName, shortName});
} }
let inputSourcesByShortName = {}; let inputSourcesByShortName = {};
@ -857,7 +857,7 @@ class InputSourceIndicator extends PanelMenu.Button {
this._menuItems = {}; this._menuItems = {};
this._indicatorLabels = {}; this._indicatorLabels = {};
this._container = new InputSourceIndicatorContainer({ style_class: 'system-status-icon' }); this._container = new InputSourceIndicatorContainer({style_class: 'system-status-icon'});
this.add_child(this._container); this.add_child(this._container);
this._propSeparator = new PopupMenu.PopupSeparatorMenuItem(); this._propSeparator = new PopupMenu.PopupSeparatorMenuItem();

View File

@ -75,7 +75,7 @@ const GeoclueAgent = GObject.registerClass({
_init() { _init() {
super._init(); super._init();
this._settings = new Gio.Settings({ schema_id: LOCATION_SCHEMA }); this._settings = new Gio.Settings({schema_id: LOCATION_SCHEMA});
this._settings.connectObject( this._settings.connectObject(
`changed::${ENABLED}`, () => this.notify('enabled'), `changed::${ENABLED}`, () => this.notify('enabled'),
`changed::${MAX_ACCURACY_LEVEL}`, () => this._onMaxAccuracyLevelChanged(), `changed::${MAX_ACCURACY_LEVEL}`, () => this._onMaxAccuracyLevelChanged(),
@ -329,10 +329,10 @@ class AppAuthorizer {
} }
export const GeolocationDialog = GObject.registerClass({ export const GeolocationDialog = GObject.registerClass({
Signals: { 'response': { param_types: [GObject.TYPE_UINT] } }, Signals: {'response': {param_types: [GObject.TYPE_UINT]}},
}, class GeolocationDialog extends ModalDialog.ModalDialog { }, class GeolocationDialog extends ModalDialog.ModalDialog {
_init(name, reason, reqAccuracyLevel) { _init(name, reason, reqAccuracyLevel) {
super._init({ styleClass: 'geolocation-dialog' }); super._init({styleClass: 'geolocation-dialog'});
this.reqAccuracyLevel = reqAccuracyLevel; this.reqAccuracyLevel = reqAccuracyLevel;
let content = new Dialog.MessageDialogContent({ let content = new Dialog.MessageDialogContent({

View File

@ -66,7 +66,7 @@ class RemoteAccessApplet extends SystemIndicator {
}); });
export const ScreenRecordingIndicator = GObject.registerClass({ export const ScreenRecordingIndicator = GObject.registerClass({
Signals: { 'menu-set': {} }, Signals: {'menu-set': {}},
}, class ScreenRecordingIndicator extends PanelMenu.ButtonBox { }, class ScreenRecordingIndicator extends PanelMenu.ButtonBox {
_init() { _init() {
super._init({ super._init({

View File

@ -25,7 +25,7 @@ export function getMixerControl() {
if (_mixerControl) if (_mixerControl)
return _mixerControl; return _mixerControl;
_mixerControl = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' }); _mixerControl = new Gvc.MixerControl({name: 'GNOME Shell Volume Control'});
_mixerControl.open(); _mixerControl.open();
return _mixerControl; return _mixerControl;

View File

@ -68,7 +68,7 @@ const EventHistory = class {
append(time, delta) { append(time, delta) {
this.trim(time); this.trim(time);
this._data.push({ time, delta }); this._data.push({time, delta});
} }
calculateVelocity() { calculateVelocity() {
@ -100,9 +100,9 @@ const TouchpadSwipeGesture = GObject.registerClass({
Clutter.Orientation, Clutter.Orientation.HORIZONTAL), Clutter.Orientation, Clutter.Orientation.HORIZONTAL),
}, },
Signals: { Signals: {
'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, 'begin': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, 'update': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
'end': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] }, 'end': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
}, },
}, class TouchpadSwipeGesture extends GObject.Object { }, class TouchpadSwipeGesture extends GObject.Object {
_init(allowedModes) { _init(allowedModes) {
@ -222,10 +222,10 @@ const TouchSwipeGesture = GObject.registerClass({
Clutter.Orientation, Clutter.Orientation.HORIZONTAL), Clutter.Orientation, Clutter.Orientation.HORIZONTAL),
}, },
Signals: { Signals: {
'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, 'begin': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, 'update': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
'end': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] }, 'end': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
'cancel': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] }, 'cancel': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
}, },
}, class TouchSwipeGesture extends Clutter.GestureAction { }, class TouchSwipeGesture extends Clutter.GestureAction {
_init(allowedModes, nTouchPoints, thresholdTriggerEdge) { _init(allowedModes, nTouchPoints, thresholdTriggerEdge) {
@ -317,9 +317,9 @@ const ScrollGesture = GObject.registerClass({
Clutter.ModifierType, 0), Clutter.ModifierType, 0),
}, },
Signals: { Signals: {
'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, 'begin': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] }, 'update': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE]},
'end': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] }, 'end': {param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE]},
}, },
}, class ScrollGesture extends GObject.Object { }, class ScrollGesture extends GObject.Object {
_init(actor, allowedModes) { _init(actor, allowedModes) {
@ -453,14 +453,14 @@ export const SwipeTracker = GObject.registerClass({
Clutter.ModifierType, 0), Clutter.ModifierType, 0),
}, },
Signals: { Signals: {
'begin': { param_types: [GObject.TYPE_UINT] }, 'begin': {param_types: [GObject.TYPE_UINT]},
'update': { param_types: [GObject.TYPE_DOUBLE] }, 'update': {param_types: [GObject.TYPE_DOUBLE]},
'end': { param_types: [GObject.TYPE_UINT64, GObject.TYPE_DOUBLE] }, 'end': {param_types: [GObject.TYPE_UINT64, GObject.TYPE_DOUBLE]},
}, },
}, class SwipeTracker extends GObject.Object { }, class SwipeTracker extends GObject.Object {
_init(actor, orientation, allowedModes, params) { _init(actor, orientation, allowedModes, params) {
super._init(); super._init();
params = Params.parse(params, { allowDrag: true, allowScroll: true }); params = Params.parse(params, {allowDrag: true, allowScroll: true});
this.orientation = orientation; this.orientation = orientation;
this._allowedModes = allowedModes; this._allowedModes = allowedModes;
@ -595,7 +595,7 @@ export const SwipeTracker = GObject.registerClass({
this._history.append(time, 0); this._history.append(time, 0);
let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 }); let rect = new Meta.Rectangle({x, y, width: 1, height: 1});
let monitor = global.display.get_monitor_index_for_rect(rect); let monitor = global.display.get_monitor_index_for_rect(rect);
this.emit('begin', monitor); this.emit('begin', monitor);

View File

@ -384,13 +384,13 @@ class SwitcherButton extends St.Button {
export const SwitcherList = GObject.registerClass({ export const SwitcherList = GObject.registerClass({
Signals: { Signals: {
'item-activated': { param_types: [GObject.TYPE_INT] }, 'item-activated': {param_types: [GObject.TYPE_INT]},
'item-entered': { param_types: [GObject.TYPE_INT] }, 'item-entered': {param_types: [GObject.TYPE_INT]},
'item-removed': { param_types: [GObject.TYPE_INT] }, 'item-removed': {param_types: [GObject.TYPE_INT]},
}, },
}, class SwitcherList extends St.Widget { }, class SwitcherList extends St.Widget {
_init(squareItems) { _init(squareItems) {
super._init({ style_class: 'switcher-list' }); super._init({style_class: 'switcher-list'});
this._list = new St.BoxLayout({ this._list = new St.BoxLayout({
style_class: 'switcher-list-item-container', style_class: 'switcher-list-item-container',

View File

@ -35,7 +35,7 @@ const BLUR_SIGMA = 45;
const SUMMARY_ICON_SIZE = 32; const SUMMARY_ICON_SIZE = 32;
const NotificationsBox = GObject.registerClass({ const NotificationsBox = GObject.registerClass({
Signals: { 'wake-up-screen': {} }, Signals: {'wake-up-screen': {}},
}, class NotificationsBox extends St.BoxLayout { }, class NotificationsBox extends St.BoxLayout {
_init() { _init() {
super._init({ super._init({
@ -43,7 +43,7 @@ const NotificationsBox = GObject.registerClass({
name: 'unlockDialogNotifications', name: 'unlockDialogNotifications',
}); });
this._scrollView = new St.ScrollView({ hscrollbar_policy: St.PolicyType.NEVER }); this._scrollView = new St.ScrollView({hscrollbar_policy: St.PolicyType.NEVER});
this._notificationBox = new St.BoxLayout({ this._notificationBox = new St.BoxLayout({
vertical: true, vertical: true,
style_class: 'unlock-dialog-notifications-container', style_class: 'unlock-dialog-notifications-container',
@ -114,10 +114,10 @@ const NotificationsBox = GObject.registerClass({
_makeNotificationDetailedSource(source, box) { _makeNotificationDetailedSource(source, box) {
let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE); let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE);
let sourceBin = new St.Bin({ child: sourceActor }); let sourceBin = new St.Bin({child: sourceActor});
box.add(sourceBin); box.add(sourceBin);
let textBox = new St.BoxLayout({ vertical: true }); let textBox = new St.BoxLayout({vertical: true});
box.add_child(textBox); box.add_child(textBox);
let title = new St.Label({ let title = new St.Label({
@ -141,7 +141,7 @@ const NotificationsBox = GObject.registerClass({
: GLib.markup_escape_text(bodyText, -1); : GLib.markup_escape_text(bodyText, -1);
} }
let label = new St.Label({ style_class: 'unlock-dialog-notification-count-text' }); let label = new St.Label({style_class: 'unlock-dialog-notification-count-text'});
label.clutter_text.set_markup(`<b>${n.title}</b> ${body}`); label.clutter_text.set_markup(`<b>${n.title}</b> ${body}`);
textBox.add(label); textBox.add(label);
@ -314,7 +314,7 @@ const NotificationsBox = GObject.registerClass({
const Clock = GObject.registerClass( const Clock = GObject.registerClass(
class UnlockDialogClock extends St.BoxLayout { class UnlockDialogClock extends St.BoxLayout {
_init() { _init() {
super._init({ style_class: 'unlock-dialog-clock', vertical: true }); super._init({style_class: 'unlock-dialog-clock', vertical: true});
this._time = new St.Label({ this._time = new St.Label({
style_class: 'unlock-dialog-clock-time', style_class: 'unlock-dialog-clock-time',
@ -334,7 +334,7 @@ class UnlockDialogClock extends St.BoxLayout {
this.add_child(this._date); this.add_child(this._date);
this.add_child(this._hint); this.add_child(this._hint);
this._wallClock = new GnomeDesktop.WallClock({ time_only: true }); this._wallClock = new GnomeDesktop.WallClock({time_only: true});
this._wallClock.connect('notify::clock', this._updateClock.bind(this)); this._wallClock.connect('notify::clock', this._updateClock.bind(this));
this._seat = Clutter.get_default_backend().get_default_seat(); this._seat = Clutter.get_default_backend().get_default_seat();
@ -543,7 +543,7 @@ export const UnlockDialog = GObject.registerClass({
// Authentication & Clock stack // Authentication & Clock stack
this._stack = new Shell.Stack(); this._stack = new Shell.Stack();
this._promptBox = new St.BoxLayout({ vertical: true }); this._promptBox = new St.BoxLayout({vertical: true});
this._promptBox.set_pivot_point(0.5, 0.5); this._promptBox.set_pivot_point(0.5, 0.5);
this._promptBox.hide(); this._promptBox.hide();
this._stack.add_child(this._promptBox); this._stack.add_child(this._promptBox);
@ -575,12 +575,12 @@ export const UnlockDialog = GObject.registerClass({
this._otherUserButton.set_pivot_point(0.5, 0.5); this._otherUserButton.set_pivot_point(0.5, 0.5);
this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this)); this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this));
this._screenSaverSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.screensaver' }); this._screenSaverSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.screensaver'});
this._screenSaverSettings.connectObject('changed::user-switch-enabled', this._screenSaverSettings.connectObject('changed::user-switch-enabled',
this._updateUserSwitchVisibility.bind(this), this); this._updateUserSwitchVisibility.bind(this), this);
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); this._lockdownSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.lockdown'});
this._lockdownSettings.connect('changed::disable-user-switching', this._lockdownSettings.connect('changed::disable-user-switching',
this._updateUserSwitchVisibility.bind(this)); this._updateUserSwitchVisibility.bind(this));
@ -591,7 +591,7 @@ export const UnlockDialog = GObject.registerClass({
// Main Box // Main Box
let mainBox = new St.Widget(); let mainBox = new St.Widget();
mainBox.add_constraint(new Layout.MonitorConstraint({ primary: true })); mainBox.add_constraint(new Layout.MonitorConstraint({primary: true}));
mainBox.add_child(this._stack); mainBox.add_child(this._stack);
mainBox.add_child(this._notificationsBox); mainBox.add_child(this._notificationsBox);
mainBox.add_child(this._otherUserButton); mainBox.add_child(this._otherUserButton);
@ -644,7 +644,7 @@ export const UnlockDialog = GObject.registerClass({
y: monitor.y, y: monitor.y,
width: monitor.width, width: monitor.width,
height: monitor.height, height: monitor.height,
effect: new Shell.BlurEffect({ name: 'blur' }), effect: new Shell.BlurEffect({name: 'blur'}),
}); });
let bgManager = new Background.BackgroundManager({ let bgManager = new Background.BackgroundManager({
@ -748,7 +748,7 @@ export const UnlockDialog = GObject.registerClass({
can_focus: progress > 0, can_focus: progress > 0,
}); });
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this._promptBox.set({ this._promptBox.set({
opacity: 255 * progress, opacity: 255 * progress,
@ -785,7 +785,7 @@ export const UnlockDialog = GObject.registerClass({
userName = null; userName = null;
} }
this._authPrompt.begin({ userName }); this._authPrompt.begin({userName});
} }
_escape() { _escape() {

View File

@ -74,7 +74,7 @@ class Avatar extends St.Bin {
iconFile = null; iconFile = null;
} }
let { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); let {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this.set_size( this.set_size(
this._iconSize * scaleFactor, this._iconSize * scaleFactor,
this._iconSize * scaleFactor); this._iconSize * scaleFactor);
@ -98,7 +98,7 @@ class Avatar extends St.Bin {
export const UserWidgetLabel = GObject.registerClass( export const UserWidgetLabel = GObject.registerClass(
class UserWidgetLabel extends St.Widget { class UserWidgetLabel extends St.Widget {
_init(user) { _init(user) {
super._init({ layout_manager: new Clutter.BinLayout() }); super._init({layout_manager: new Clutter.BinLayout()});
this._user = user; this._user = user;

View File

@ -19,7 +19,7 @@ const DialogResponse = {
export const WelcomeDialog = GObject.registerClass( export const WelcomeDialog = GObject.registerClass(
class WelcomeDialog extends ModalDialog.ModalDialog { class WelcomeDialog extends ModalDialog.ModalDialog {
_init() { _init() {
super._init({ styleClass: 'welcome-dialog' }); super._init({styleClass: 'welcome-dialog'});
const appSystem = Shell.AppSystem.get_default(); const appSystem = Shell.AppSystem.get_default();
this._tourAppInfo = appSystem.lookup_app('org.gnome.Tour.desktop'); this._tourAppInfo = appSystem.lookup_app('org.gnome.Tour.desktop');
@ -38,9 +38,9 @@ class WelcomeDialog extends ModalDialog.ModalDialog {
const [majorVersion] = Config.PACKAGE_VERSION.split('.'); const [majorVersion] = Config.PACKAGE_VERSION.split('.');
const title = _('Welcome to GNOME %s').format(majorVersion); const title = _('Welcome to GNOME %s').format(majorVersion);
const description = _('If you want to learn your way around, check out the tour.'); const description = _('If you want to learn your way around, check out the tour.');
const content = new Dialog.MessageDialogContent({ title, description }); const content = new Dialog.MessageDialogContent({title, description});
const icon = new St.Widget({ style_class: 'welcome-dialog-image' }); const icon = new St.Widget({style_class: 'welcome-dialog-image'});
content.insert_child_at_index(icon, 0); content.insert_child_at_index(icon, 0);
this.contentLayout.add_child(content); this.contentLayout.add_child(content);

View File

@ -69,7 +69,7 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog {
let title = _('Keep these display settings?'); let title = _('Keep these display settings?');
let description = this._formatCountDown(); let description = this._formatCountDown();
this._content = new Dialog.MessageDialogContent({ title, description }); this._content = new Dialog.MessageDialogContent({title, description});
this.contentLayout.add_child(this._content); this.contentLayout.add_child(this._content);
/* Translators: this and the following message should be limited in length, /* Translators: this and the following message should be limited in length,
@ -208,7 +208,7 @@ class WorkspaceTracker {
global.display.connect('window-left-monitor', global.display.connect('window-left-monitor',
this._windowLeftMonitor.bind(this)); this._windowLeftMonitor.bind(this));
this._workspaceSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' }); this._workspaceSettings = new Gio.Settings({schema_id: 'org.gnome.mutter'});
this._workspaceSettings.connect('changed::dynamic-workspaces', this._queueCheckWorkspaces.bind(this)); this._workspaceSettings.connect('changed::dynamic-workspaces', this._queueCheckWorkspaces.bind(this));
this._nWorkspacesChanged(); this._nWorkspacesChanged();
@ -476,7 +476,7 @@ class TilePreview extends St.Widget {
}); });
const AppSwitchAction = GObject.registerClass({ const AppSwitchAction = GObject.registerClass({
Signals: { 'activated': {} }, Signals: {'activated': {}},
}, class AppSwitchAction extends Clutter.GestureAction { }, class AppSwitchAction extends Clutter.GestureAction {
_init() { _init() {
super._init(); super._init();
@ -535,7 +535,7 @@ const AppSwitchAction = GObject.registerClass({
const ResizePopup = GObject.registerClass( const ResizePopup = GObject.registerClass(
class ResizePopup extends St.Widget { class ResizePopup extends St.Widget {
_init() { _init() {
super._init({ layout_manager: new Clutter.BinLayout() }); super._init({layout_manager: new Clutter.BinLayout()});
this._label = new St.Label({ this._label = new St.Label({
style_class: 'resize-popup', style_class: 'resize-popup',
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,
@ -1302,7 +1302,7 @@ export class WindowManager {
// Position a clone of the window on top of the old position, // Position a clone of the window on top of the old position,
// while actor updates are frozen. // while actor updates are frozen.
let actorContent = actor.paint_to_content(oldFrameRect); let actorContent = actor.paint_to_content(oldFrameRect);
let actorClone = new St.Widget({ content: actorContent }); let actorClone = new St.Widget({content: actorContent});
actorClone.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); actorClone.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
actorClone.set_position(oldFrameRect.x, oldFrameRect.y); actorClone.set_position(oldFrameRect.x, oldFrameRect.y);
actorClone.set_size(oldFrameRect.width, oldFrameRect.height); actorClone.set_size(oldFrameRect.width, oldFrameRect.height);

View File

@ -217,7 +217,7 @@ export class WindowMenuManager {
constructor() { constructor() {
this._manager = new PopupMenu.PopupMenuManager(Main.layoutManager.dummyCursor); this._manager = new PopupMenu.PopupMenuManager(Main.layoutManager.dummyCursor);
this._sourceActor = new St.Widget({ reactive: true, visible: false }); this._sourceActor = new St.Widget({reactive: true, visible: false});
this._sourceActor.connect('button-press-event', () => { this._sourceActor.connect('button-press-event', () => {
this._manager.activeMenu.toggle(); this._manager.activeMenu.toggle();
}); });

View File

@ -39,7 +39,7 @@ export const WindowPreview = GObject.registerClass({
'drag-begin': {}, 'drag-begin': {},
'drag-cancelled': {}, 'drag-cancelled': {},
'drag-end': {}, 'drag-end': {},
'selected': { param_types: [GObject.TYPE_UINT] }, 'selected': {param_types: [GObject.TYPE_UINT]},
'show-chrome': {}, 'show-chrome': {},
'size-changed': {}, 'size-changed': {},
}, },
@ -59,7 +59,7 @@ export const WindowPreview = GObject.registerClass({
}); });
const windowContainer = new Clutter.Actor({ const windowContainer = new Clutter.Actor({
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
}); });
this.window_container = windowContainer; this.window_container = windowContainer;
@ -136,7 +136,7 @@ export const WindowPreview = GObject.registerClass({
this._icon.add_style_class_name('icon-dropshadow'); this._icon.add_style_class_name('icon-dropshadow');
this._icon.set({ this._icon.set({
reactive: true, reactive: true,
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
}); });
this._icon.add_constraint(new Clutter.BindConstraint({ this._icon.add_constraint(new Clutter.BindConstraint({
source: windowContainer, source: windowContainer,
@ -150,11 +150,11 @@ export const WindowPreview = GObject.registerClass({
this._icon.add_constraint(new Clutter.AlignConstraint({ this._icon.add_constraint(new Clutter.AlignConstraint({
source: windowContainer, source: windowContainer,
align_axis: Clutter.AlignAxis.Y_AXIS, align_axis: Clutter.AlignAxis.Y_AXIS,
pivot_point: new Graphene.Point({ x: -1, y: ICON_OVERLAP }), pivot_point: new Graphene.Point({x: -1, y: ICON_OVERLAP}),
factor: 1, factor: 1,
})); }));
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
this._title = new St.Label({ this._title = new St.Label({
visible: false, visible: false,
style_class: 'window-caption', style_class: 'window-caption',
@ -180,7 +180,7 @@ export const WindowPreview = GObject.registerClass({
this._title.add_constraint(new Clutter.AlignConstraint({ this._title.add_constraint(new Clutter.AlignConstraint({
source: windowContainer, source: windowContainer,
align_axis: Clutter.AlignAxis.Y_AXIS, align_axis: Clutter.AlignAxis.Y_AXIS,
pivot_point: new Graphene.Point({ x: -1, y: 0 }), pivot_point: new Graphene.Point({x: -1, y: 0}),
factor: 1, factor: 1,
})); }));
this._title.clutter_text.ellipsize = Pango.EllipsizeMode.END; this._title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
@ -206,13 +206,13 @@ export const WindowPreview = GObject.registerClass({
this._closeButton.add_constraint(new Clutter.AlignConstraint({ this._closeButton.add_constraint(new Clutter.AlignConstraint({
source: windowContainer, source: windowContainer,
align_axis: Clutter.AlignAxis.X_AXIS, align_axis: Clutter.AlignAxis.X_AXIS,
pivot_point: new Graphene.Point({ x: 0.5, y: -1 }), pivot_point: new Graphene.Point({x: 0.5, y: -1}),
factor: this._closeButtonSide === St.Side.LEFT ? 0 : 1, factor: this._closeButtonSide === St.Side.LEFT ? 0 : 1,
})); }));
this._closeButton.add_constraint(new Clutter.AlignConstraint({ this._closeButton.add_constraint(new Clutter.AlignConstraint({
source: windowContainer, source: windowContainer,
align_axis: Clutter.AlignAxis.Y_AXIS, align_axis: Clutter.AlignAxis.Y_AXIS,
pivot_point: new Graphene.Point({ x: -1, y: 0.5 }), pivot_point: new Graphene.Point({x: -1, y: 0.5}),
factor: 0, factor: 0,
})); }));
this._closeButton.connect('clicked', () => this._deleteAll()); this._closeButton.connect('clicked', () => this._deleteAll());
@ -235,8 +235,8 @@ export const WindowPreview = GObject.registerClass({
} }
_updateIconScale() { _updateIconScale() {
const { ControlsState } = OverviewControls; const {ControlsState} = OverviewControls;
const { currentState, initialState, finalState } = const {currentState, initialState, finalState} =
this._overviewAdjustment.getStateTransitionParams(); this._overviewAdjustment.getStateTransitionParams();
const visible = const visible =
initialState === ControlsState.WINDOW_PICKER || initialState === ControlsState.WINDOW_PICKER ||
@ -276,7 +276,7 @@ export const WindowPreview = GObject.registerClass({
chromeHeights() { chromeHeights() {
const [, closeButtonHeight] = this._closeButton.get_preferred_height(-1); const [, closeButtonHeight] = this._closeButton.get_preferred_height(-1);
const [, iconHeight] = this._icon.get_preferred_height(-1); const [, iconHeight] = this._icon.get_preferred_height(-1);
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * scaleFactor; const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * scaleFactor;
const topOversize = closeButtonHeight / 2; const topOversize = closeButtonHeight / 2;
@ -290,7 +290,7 @@ export const WindowPreview = GObject.registerClass({
chromeWidths() { chromeWidths() {
const [, closeButtonWidth] = this._closeButton.get_preferred_width(-1); const [, closeButtonWidth] = this._closeButton.get_preferred_width(-1);
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * scaleFactor; const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * scaleFactor;
const leftOversize = this._closeButtonSide === St.Side.LEFT const leftOversize = this._closeButtonSide === St.Side.LEFT
@ -339,7 +339,7 @@ export const WindowPreview = GObject.registerClass({
}); });
const [width, height] = this.window_container.get_size(); const [width, height] = this.window_container.get_size();
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * 2 * scaleFactor; const activeExtraSize = WINDOW_ACTIVE_SIZE_INC * 2 * scaleFactor;
const origSize = Math.max(width, height); const origSize = Math.max(width, height);
const scale = (origSize + activeExtraSize) / origSize; const scale = (origSize + activeExtraSize) / origSize;
@ -475,7 +475,7 @@ export const WindowPreview = GObject.registerClass({
} }
get boundingBox() { get boundingBox() {
return { ...this._cachedBoundingBox }; return {...this._cachedBoundingBox};
} }
get windowCenter() { get windowCenter() {

View File

@ -184,7 +184,7 @@ class UnalignedLayoutStrategy extends LayoutStrategy {
} }
_computeRowSizes(layout) { _computeRowSizes(layout) {
let { rows, scale } = layout; let {rows, scale} = layout;
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let row = rows[i]; let row = rows[i];
row.width = row.fullWidth * scale + (row.windows.length - 1) * this._columnSpacing; row.width = row.fullWidth * scale + (row.windows.length - 1) * this._columnSpacing;
@ -304,7 +304,7 @@ class UnalignedLayoutStrategy extends LayoutStrategy {
computeWindowSlots(layout, area) { computeWindowSlots(layout, area) {
this._computeRowSizes(layout); this._computeRowSizes(layout);
let { rows, scale } = layout; let {rows, scale} = layout;
let slots = []; let slots = [];
@ -453,7 +453,7 @@ export const WorkspaceLayout = GObject.registerClass({
} }
_syncOpacities() { _syncOpacities() {
this._windows.forEach(({ metaWindow }, actor) => { this._windows.forEach(({metaWindow}, actor) => {
this._syncOpacity(actor, metaWindow); this._syncOpacity(actor, metaWindow);
}); });
} }
@ -499,7 +499,7 @@ export const WorkspaceLayout = GObject.registerClass({
if (containerBox) { if (containerBox) {
const monitor = Main.layoutManager.monitors[this._monitorIndex]; const monitor = Main.layoutManager.monitors[this._monitorIndex];
const bottomPoint = new Graphene.Point3D({ y: containerBox.y2 }); const bottomPoint = new Graphene.Point3D({y: containerBox.y2});
const transformedBottomPoint = const transformedBottomPoint =
this._container.apply_transform_to_point(bottomPoint); this._container.apply_transform_to_point(bottomPoint);
const bottomFreeSpace = const bottomFreeSpace =
@ -646,8 +646,8 @@ export const WorkspaceLayout = GObject.registerClass({
this.notify('layout-frozen'); this.notify('layout-frozen');
} }
const { ControlsState } = OverviewControls; const {ControlsState} = OverviewControls;
const { currentState } = const {currentState} =
this._overviewAdjustment.getStateTransitionParams(); this._overviewAdjustment.getStateTransitionParams();
const inSessionTransition = currentState <= ControlsState.WINDOW_PICKER; const inSessionTransition = currentState <= ControlsState.WINDOW_PICKER;
@ -1005,7 +1005,7 @@ class WorkspaceBackground extends Shell.WorkspaceBackground {
} }
_updateBorderRadius() { _updateBorderRadius() {
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage); const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const cornerRadius = scaleFactor * BACKGROUND_CORNER_RADIUS_PIXELS; const cornerRadius = scaleFactor * BACKGROUND_CORNER_RADIUS_PIXELS;
const backgroundContent = this._bgManager.backgroundActor.content; const backgroundContent = this._bgManager.backgroundActor.content;
@ -1041,7 +1041,7 @@ class Workspace extends St.Widget {
_init(metaWorkspace, monitorIndex, overviewAdjustment) { _init(metaWorkspace, monitorIndex, overviewAdjustment) {
super._init({ super._init({
style_class: 'window-picker', style_class: 'window-picker',
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
layout_manager: new Clutter.BinLayout(), layout_manager: new Clutter.BinLayout(),
}); });

View File

@ -101,7 +101,7 @@ class WorkspaceGroup extends Clutter.Actor {
this.add_child(clone); this.add_child(clone);
const record = { windowActor, clone }; const record = {windowActor, clone};
windowActor.connectObject('destroy', () => { windowActor.connectObject('destroy', () => {
clone.destroy(); clone.destroy();
@ -143,7 +143,7 @@ const MonitorGroup = GObject.registerClass({
this._monitor = monitor; this._monitor = monitor;
const constraint = new Layout.MonitorConstraint({ index: monitor.index }); const constraint = new Layout.MonitorConstraint({index: monitor.index});
this.add_constraint(constraint); this.add_constraint(constraint);
this._container = new Clutter.Actor(); this._container = new Clutter.Actor();
@ -289,7 +289,7 @@ export class WorkspaceAnimationController {
const swipeTracker = new SwipeTracker.SwipeTracker(global.stage, const swipeTracker = new SwipeTracker.SwipeTracker(global.stage,
Clutter.Orientation.HORIZONTAL, Clutter.Orientation.HORIZONTAL,
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
{ allowDrag: false }); {allowDrag: false});
swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this)); swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this)); swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));
swipeTracker.connect('end', this._switchWorkspaceEnd.bind(this)); swipeTracker.connect('end', this._switchWorkspaceEnd.bind(this));

View File

@ -23,7 +23,7 @@ class WorkspaceSwitcherPopup extends Clutter.Actor {
y_align: Clutter.ActorAlign.END, y_align: Clutter.ActorAlign.END,
}); });
const constraint = new Layout.MonitorConstraint({ primary: true }); const constraint = new Layout.MonitorConstraint({primary: true});
this.add_constraint(constraint); this.add_constraint(constraint);
Main.uiGroup.add_actor(this); Main.uiGroup.add_actor(this);

View File

@ -56,11 +56,11 @@ export const WindowClone = GObject.registerClass({
'drag-begin': {}, 'drag-begin': {},
'drag-cancelled': {}, 'drag-cancelled': {},
'drag-end': {}, 'drag-end': {},
'selected': { param_types: [GObject.TYPE_UINT] }, 'selected': {param_types: [GObject.TYPE_UINT]},
}, },
}, class WindowClone extends Clutter.Actor { }, class WindowClone extends Clutter.Actor {
_init(realWindow) { _init(realWindow) {
let clone = new Clutter.Clone({ source: realWindow }); let clone = new Clutter.Clone({source: realWindow});
super._init({ super._init({
layout_manager: new PrimaryActorLayout(clone), layout_manager: new PrimaryActorLayout(clone),
reactive: true, reactive: true,
@ -151,7 +151,7 @@ export const WindowClone = GObject.registerClass({
} }
_doAddAttachedDialog(metaDialog, realDialog) { _doAddAttachedDialog(metaDialog, realDialog) {
let clone = new Clutter.Clone({ source: realDialog }); let clone = new Clutter.Clone({source: realDialog});
this._updateDialogPosition(realDialog, clone); this._updateDialogPosition(realDialog, clone);
realDialog.connectObject( realDialog.connectObject(
@ -242,7 +242,7 @@ export const WorkspaceThumbnail = GObject.registerClass({
super._init({ super._init({
clip_to_allocation: true, clip_to_allocation: true,
style_class: 'workspace-thumbnail', style_class: 'workspace-thumbnail',
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
}); });
this._delegate = this; this._delegate = this;
@ -593,12 +593,12 @@ export const ThumbnailsBox = GObject.registerClass({
style_class: 'workspace-thumbnails', style_class: 'workspace-thumbnails',
reactive: true, reactive: true,
x_align: Clutter.ActorAlign.CENTER, x_align: Clutter.ActorAlign.CENTER,
pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), pivot_point: new Graphene.Point({x: 0.5, y: 0.5}),
}); });
this._delegate = this; this._delegate = this;
let indicator = new St.Bin({ style_class: 'workspace-thumbnail-indicator' }); let indicator = new St.Bin({style_class: 'workspace-thumbnail-indicator'});
// We don't want the indicator to affect drag-and-drop // We don't want the indicator to affect drag-and-drop
Shell.util_set_hidden_from_pick(indicator, true); Shell.util_set_hidden_from_pick(indicator, true);
@ -610,7 +610,7 @@ export const ThumbnailsBox = GObject.registerClass({
this._dropWorkspace = -1; this._dropWorkspace = -1;
this._dropPlaceholderPos = -1; this._dropPlaceholderPos = -1;
this._dropPlaceholder = new St.Bin({ style_class: 'placeholder' }); this._dropPlaceholder = new St.Bin({style_class: 'placeholder'});
this.add_actor(this._dropPlaceholder); this.add_actor(this._dropPlaceholder);
this._spliceIndex = -1; this._spliceIndex = -1;
@ -647,7 +647,7 @@ export const ThumbnailsBox = GObject.registerClass({
'window-drag-end', () => this._onDragEnd(), 'window-drag-end', () => this._onDragEnd(),
'window-drag-cancelled', () => this._onDragCancelled(), this); 'window-drag-cancelled', () => this._onDragCancelled(), this);
this._settings = new Gio.Settings({ schema_id: MUTTER_SCHEMA }); this._settings = new Gio.Settings({schema_id: MUTTER_SCHEMA});
this._settings.connect('changed::dynamic-workspaces', this._settings.connect('changed::dynamic-workspaces',
() => this._updateShouldShow()); () => this._updateShouldShow());
this._updateShouldShow(); this._updateShouldShow();
@ -688,7 +688,7 @@ export const ThumbnailsBox = GObject.registerClass({
} }
_updateShouldShow() { _updateShouldShow() {
const { nWorkspaces } = global.workspace_manager; const {nWorkspaces} = global.workspace_manager;
const shouldShow = this._settings.get_boolean('dynamic-workspaces') const shouldShow = this._settings.get_boolean('dynamic-workspaces')
? nWorkspaces > NUM_WORKSPACES_THRESHOLD ? nWorkspaces > NUM_WORKSPACES_THRESHOLD
: nWorkspaces > 1; : nWorkspaces > 1;
@ -701,8 +701,8 @@ export const ThumbnailsBox = GObject.registerClass({
} }
_updateIndicator() { _updateIndicator() {
const { value } = this._scrollAdjustment; const {value} = this._scrollAdjustment;
const { workspaceManager } = global; const {workspaceManager} = global;
const activeIndex = workspaceManager.get_active_workspace_index(); const activeIndex = workspaceManager.get_active_workspace_index();
this._animatingIndicator = value !== activeIndex; this._animatingIndicator = value !== activeIndex;
@ -926,7 +926,7 @@ export const ThumbnailsBox = GObject.registerClass({
if (this._thumbnails.length > 0) if (this._thumbnails.length > 0)
return; return;
const { workspaceManager } = global; const {workspaceManager} = global;
this._transientSignalHolder = new TransientSignalHolder(this); this._transientSignalHolder = new TransientSignalHolder(this);
workspaceManager.connectObject( workspaceManager.connectObject(
'notify::n-workspaces', this._workspacesChanged.bind(this), 'notify::n-workspaces', this._workspacesChanged.bind(this),
@ -1230,8 +1230,8 @@ export const ThumbnailsBox = GObject.registerClass({
_updatePorthole() { _updatePorthole() {
if (!Main.layoutManager.monitors[this._monitorIndex]) { if (!Main.layoutManager.monitors[this._monitorIndex]) {
const { x, y, width, height } = global.stage; const {x, y, width, height} = global.stage;
this._porthole = { x, y, width, height }; this._porthole = {x, y, width, height};
} else { } else {
this._porthole = this._porthole =
Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex); Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex);

View File

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

View File

@ -15,7 +15,7 @@ export class XdndHandler extends Signals.EventEmitter {
this._cursorWindowClone = null; this._cursorWindowClone = null;
// Used as a drag actor in case we don't have a cursor window clone // Used as a drag actor in case we don't have a cursor window clone
this._dummy = new Clutter.Actor({ width: 1, height: 1, opacity: 0 }); this._dummy = new Clutter.Actor({width: 1, height: 1, opacity: 0});
Main.uiGroup.add_actor(this._dummy); Main.uiGroup.add_actor(this._dummy);
this._dummy.hide(); this._dummy.hide();
@ -60,7 +60,7 @@ export class XdndHandler extends Signals.EventEmitter {
source: cursorWindow, source: cursorWindow,
}); });
this._cursorWindowClone = new Clutter.Clone({ source: cursorWindow }); this._cursorWindowClone = new Clutter.Clone({source: cursorWindow});
Main.uiGroup.add_actor(this._cursorWindowClone); Main.uiGroup.add_actor(this._cursorWindowClone);
// Make sure that the clone has the same position as the source // Make sure that the clone has the same position as the source

View File

@ -18,6 +18,3 @@ rules:
jsdoc/require-param-description: off jsdoc/require-param-description: off
jsdoc/require-param-name: off jsdoc/require-param-name: off
jsdoc/require-param-type: off jsdoc/require-param-type: off
object-curly-spacing:
- error
- always

View File

@ -44,7 +44,7 @@ var Application = GObject.registerClass(
class Application extends Adw.Application { class Application extends Adw.Application {
_init() { _init() {
GLib.set_prgname('gnome-extensions-app'); GLib.set_prgname('gnome-extensions-app');
super._init({ application_id: Package.name }); super._init({application_id: Package.name});
this.connect('window-removed', (a, window) => window.run_dispose()); this.connect('window-removed', (a, window) => window.run_dispose());
} }
@ -72,7 +72,7 @@ class Application extends Adw.Application {
this._shellProxy = new GnomeShellProxy(Gio.DBus.session, this._shellProxy = new GnomeShellProxy(Gio.DBus.session,
'org.gnome.Shell.Extensions', '/org/gnome/Shell/Extensions'); 'org.gnome.Shell.Extensions', '/org/gnome/Shell/Extensions');
this._window = new ExtensionsWindow({ application: this }); this._window = new ExtensionsWindow({application: this});
} }
}); });
@ -100,7 +100,7 @@ var ExtensionsWindow = GObject.registerClass({
this._updatesCheckId = 0; this._updatesCheckId = 0;
this._exporter = new Shew.WindowExporter({ window: this }); this._exporter = new Shew.WindowExporter({window: this});
this._exportedHandle = ''; this._exportedHandle = '';
this.add_action_entries( this.add_action_entries(
@ -120,7 +120,7 @@ var ExtensionsWindow = GObject.registerClass({
this._searchTerms = []; this._searchTerms = [];
this._searchEntry.connect('search-changed', () => { this._searchEntry.connect('search-changed', () => {
const { text } = this._searchEntry; const {text} = this._searchEntry;
if (text === '') if (text === '')
this._searchTerms = []; this._searchTerms = [];
else else
@ -458,7 +458,7 @@ var ExtensionRow = GObject.registerClass({
} }
get hasError() { get hasError() {
const { state } = this._extension; const {state} = this._extension;
return state === ExtensionState.OUT_OF_DATE || return state === ExtensionState.OUT_OF_DATE ||
state === ExtensionState.ERROR; state === ExtensionState.ERROR;
} }