cleanup: Use object shorthand where possible
ES6 allows to omit property names where they match the name of the assigned variable, which makes code less redunant and thus cleaner. We will soon enforce that in our eslint rules, so make sure we use the shorthand wherever possible. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:
parent
9eaa0089d0
commit
c860409da5
@ -126,7 +126,7 @@ class Application extends Gtk.Application {
|
|||||||
|
|
||||||
let buffer = new Gtk.TextBuffer({ text: errortext });
|
let buffer = new Gtk.TextBuffer({ text: errortext });
|
||||||
let textview = new Gtk.TextView({
|
let textview = new Gtk.TextView({
|
||||||
buffer: buffer,
|
buffer,
|
||||||
wrap_mode: Gtk.WrapMode.WORD,
|
wrap_mode: Gtk.WrapMode.WORD,
|
||||||
monospace: true,
|
monospace: true,
|
||||||
editable: false,
|
editable: false,
|
||||||
|
@ -64,7 +64,7 @@ var 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: 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));
|
||||||
|
@ -1134,8 +1134,7 @@ var 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: userName,
|
this._authPrompt.begin({ userName, hold });
|
||||||
hold: hold });
|
|
||||||
return hold;
|
return hold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ var ShellUserVerifier = class {
|
|||||||
let interval = this._getIntervalForMessage(message);
|
let interval = this._getIntervalForMessage(message);
|
||||||
|
|
||||||
this.hasPendingMessages = true;
|
this.hasPendingMessages = true;
|
||||||
this._messageQueue.push({ text: message, type: messageType, interval: interval });
|
this._messageQueue.push({ text: message, type: messageType, interval });
|
||||||
this._queueMessageTimeout();
|
this._queueMessageTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ var LoginManagerSystemd = class {
|
|||||||
try {
|
try {
|
||||||
let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
|
let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
|
||||||
fd = fdList.steal_fds()[0];
|
fd = fdList.steal_fds()[0];
|
||||||
callback(new Gio.UnixInputStream({ fd: fd }));
|
callback(new Gio.UnixInputStream({ fd }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e, "Error getting systemd inhibitor");
|
logError(e, "Error getting systemd inhibitor");
|
||||||
callback(null);
|
callback(null);
|
||||||
|
@ -121,8 +121,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,
|
throw new (err.constructor)({ code: err.code, message });
|
||||||
message: message });
|
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ class PortalHeaderBar extends Gtk.HeaderBar {
|
|||||||
var PortalWindow = GObject.registerClass(
|
var PortalWindow = GObject.registerClass(
|
||||||
class PortalWindow extends Gtk.ApplicationWindow {
|
class PortalWindow extends Gtk.ApplicationWindow {
|
||||||
_init(application, url, timestamp, doneCallback) {
|
_init(application, url, timestamp, doneCallback) {
|
||||||
super._init({ application: application });
|
super._init({ application });
|
||||||
|
|
||||||
this.connect('delete-event', this.destroyWindow.bind(this));
|
this.connect('delete-event', this.destroyWindow.bind(this));
|
||||||
this._headerBar = new PortalHeaderBar();
|
this._headerBar = new PortalHeaderBar();
|
||||||
@ -287,7 +287,7 @@ class WebPortalHelper extends Gtk.Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Authenticate(connection, url, timestamp) {
|
Authenticate(connection, url, timestamp) {
|
||||||
this._queue.push({ connection: connection, url: url, timestamp: timestamp });
|
this._queue.push({ connection, url, timestamp });
|
||||||
|
|
||||||
this._processQueue();
|
this._processQueue();
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ class CyclerHighlight extends St.Widget {
|
|||||||
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: 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);
|
||||||
|
@ -10,7 +10,7 @@ var SPINNER_ANIMATION_DELAY = 1000;
|
|||||||
var Animation = GObject.registerClass(
|
var Animation = GObject.registerClass(
|
||||||
class Animation extends St.Bin {
|
class Animation extends St.Bin {
|
||||||
_init(file, width, height, speed) {
|
_init(file, width, height, speed) {
|
||||||
super._init({ width: width, height: height });
|
super._init({ width, height });
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
this.connect('resource-scale-changed',
|
this.connect('resource-scale-changed',
|
||||||
this._loadFile.bind(this, file, width, height));
|
this._loadFile.bind(this, file, width, height));
|
||||||
|
@ -710,7 +710,7 @@ var AllView = GObject.registerClass({
|
|||||||
else
|
else
|
||||||
opacity = 255;
|
opacity = 255;
|
||||||
this._items[id].ease({
|
this._items[id].ease({
|
||||||
opacity: opacity,
|
opacity,
|
||||||
duration: INACTIVE_GRID_OPACITY_ANIMATION_TIME,
|
duration: INACTIVE_GRID_OPACITY_ANIMATION_TIME,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
||||||
});
|
});
|
||||||
@ -1029,14 +1029,14 @@ class AppDisplay extends St.BoxLayout {
|
|||||||
style_class: 'app-view-control button',
|
style_class: 'app-view-control button',
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
x_expand: true });
|
x_expand: true });
|
||||||
this._views[Views.FREQUENT] = { 'view': view, 'control': button };
|
this._views[Views.FREQUENT] = { view, 'control': button };
|
||||||
|
|
||||||
view = new AllView();
|
view = new AllView();
|
||||||
button = new St.Button({ label: _("All"),
|
button = new St.Button({ label: _("All"),
|
||||||
style_class: 'app-view-control button',
|
style_class: 'app-view-control button',
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
x_expand: true });
|
x_expand: true });
|
||||||
this._views[Views.ALL] = { 'view': view, 'control': button };
|
this._views[Views.ALL] = { view, 'control': button };
|
||||||
|
|
||||||
this._viewStackLayout = new ViewStackLayout();
|
this._viewStackLayout = new ViewStackLayout();
|
||||||
this._viewStack = new St.Widget({ x_expand: true, y_expand: true,
|
this._viewStack = new St.Widget({ x_expand: true, y_expand: true,
|
||||||
@ -1472,7 +1472,7 @@ var FolderIcon = GObject.registerClass({
|
|||||||
this._parentView = parentView;
|
this._parentView = parentView;
|
||||||
|
|
||||||
this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
|
this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
|
||||||
path: path });
|
path });
|
||||||
this._delegate = this;
|
this._delegate = this;
|
||||||
// whether we need to update arrow side, position etc.
|
// whether we need to update arrow side, position etc.
|
||||||
this._popupInvalidated = false;
|
this._popupInvalidated = false;
|
||||||
|
@ -444,7 +444,7 @@ var Background = GObject.registerClass({
|
|||||||
|
|
||||||
_loadAnimation(file) {
|
_loadAnimation(file) {
|
||||||
this._cache.getAnimation({
|
this._cache.getAnimation({
|
||||||
file: file,
|
file,
|
||||||
settingsSchema: this._settings.schema_id,
|
settingsSchema: this._settings.schema_id,
|
||||||
onLoaded: animation => {
|
onLoaded: animation => {
|
||||||
this._animation = animation;
|
this._animation = animation;
|
||||||
@ -592,11 +592,11 @@ var BackgroundSource = class BackgroundSource {
|
|||||||
|
|
||||||
if (!(monitorIndex in this._backgrounds)) {
|
if (!(monitorIndex in this._backgrounds)) {
|
||||||
let background = new Background({
|
let background = new Background({
|
||||||
monitorIndex: monitorIndex,
|
monitorIndex,
|
||||||
layoutManager: this._layoutManager,
|
layoutManager: this._layoutManager,
|
||||||
settings: this._settings,
|
settings: this._settings,
|
||||||
file: file,
|
file,
|
||||||
style: style
|
style
|
||||||
});
|
});
|
||||||
|
|
||||||
background._changedId = background.connect('bg-changed', () => {
|
background._changedId = background.connect('bg-changed', () => {
|
||||||
|
@ -230,7 +230,7 @@ var AutomountManager = class {
|
|||||||
let existingDialog = prevOperation ? prevOperation.borrowDialog() : null;
|
let existingDialog = prevOperation ? prevOperation.borrowDialog() : null;
|
||||||
let operation =
|
let operation =
|
||||||
new ShellMountOperation.ShellMountOperation(volume,
|
new ShellMountOperation.ShellMountOperation(volume,
|
||||||
{ existingDialog: existingDialog });
|
{ existingDialog });
|
||||||
this._mountVolume(volume, operation);
|
this._mountVolume(volume, operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
|
secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
|
||||||
text: secret.value, can_focus: reactive,
|
text: secret.value, can_focus: reactive,
|
||||||
reactive: reactive,
|
reactive,
|
||||||
x_expand: true });
|
x_expand: true });
|
||||||
ShellEntry.addContextMenu(secret.entry,
|
ShellEntry.addContextMenu(secret.entry,
|
||||||
{ isPassword: secret.password });
|
{ isPassword: secret.password });
|
||||||
@ -553,7 +553,7 @@ var VPNRequestHandler = class {
|
|||||||
contentOverride.secrets.push({
|
contentOverride.secrets.push({
|
||||||
label: keyfile.get_string(groups[i], 'Label'),
|
label: keyfile.get_string(groups[i], 'Label'),
|
||||||
key: groups[i],
|
key: groups[i],
|
||||||
value: value,
|
value,
|
||||||
password: keyfile.get_boolean(groups[i], 'IsSecret'),
|
password: keyfile.get_boolean(groups[i], 'IsSecret'),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -49,10 +49,10 @@ function makeMessageFromTpMessage(tpMessage, direction) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
messageType: tpMessage.get_message_type(),
|
messageType: tpMessage.get_message_type(),
|
||||||
text: text,
|
text,
|
||||||
sender: tpMessage.sender.alias,
|
sender: tpMessage.sender.alias,
|
||||||
timestamp: timestamp,
|
timestamp,
|
||||||
direction: direction
|
direction
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ function makeMessageFromTplEvent(event) {
|
|||||||
text: event.get_message(),
|
text: event.get_message(),
|
||||||
sender: event.get_sender().get_alias(),
|
sender: event.get_sender().get_alias(),
|
||||||
timestamp: event.get_timestamp(),
|
timestamp: event.get_timestamp(),
|
||||||
direction: direction
|
direction
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ 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: file });
|
return new Gio.FileIcon({ file });
|
||||||
else
|
else
|
||||||
return new Gio.ThemedIcon({ name: 'avatar-default' });
|
return new Gio.ThemedIcon({ name: 'avatar-default' });
|
||||||
}
|
}
|
||||||
@ -683,10 +683,10 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
|
|||||||
? 'received' : 'sent');
|
? 'received' : 'sent');
|
||||||
|
|
||||||
this._append({ body: messageBody,
|
this._append({ body: messageBody,
|
||||||
group: group,
|
group,
|
||||||
styles: styles,
|
styles,
|
||||||
timestamp: message.timestamp,
|
timestamp: message.timestamp,
|
||||||
noTimestamp: noTimestamp });
|
noTimestamp });
|
||||||
}
|
}
|
||||||
|
|
||||||
_filterMessages() {
|
_filterMessages() {
|
||||||
|
@ -104,7 +104,7 @@ var CtrlAltTabManager = class CtrlAltTabManager {
|
|||||||
Main.activateWindow(windows[i], timestamp);
|
Main.activateWindow(windows[i], timestamp);
|
||||||
},
|
},
|
||||||
iconActor: icon,
|
iconActor: icon,
|
||||||
iconName: iconName,
|
iconName,
|
||||||
sortGroup: SortGroup.MIDDLE });
|
sortGroup: SortGroup.MIDDLE });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ class Dialog extends St.Widget {
|
|||||||
can_focus: true,
|
can_focus: true,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
label: label });
|
label });
|
||||||
button.connect('clicked', action);
|
button.connect('clicked', action);
|
||||||
|
|
||||||
buttonInfo['button'] = button;
|
buttonInfo['button'] = button;
|
||||||
|
@ -456,7 +456,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
this._confirm(signal);
|
this._confirm(signal);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
label: label,
|
label,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ var REPOSITORY_URL_UPDATE = `${REPOSITORY_URL_BASE}/update-info/`;
|
|||||||
let _httpSession;
|
let _httpSession;
|
||||||
|
|
||||||
function installExtension(uuid, invocation) {
|
function installExtension(uuid, invocation) {
|
||||||
let params = { uuid: uuid,
|
let params = { uuid,
|
||||||
shell_version: Config.PACKAGE_VERSION };
|
shell_version: Config.PACKAGE_VERSION };
|
||||||
|
|
||||||
let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
|
let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
|
||||||
|
@ -487,7 +487,7 @@ var IconGrid = GObject.registerClass({
|
|||||||
scale_y: ANIMATION_BOUNCE_ICON_SCALE,
|
scale_y: ANIMATION_BOUNCE_ICON_SCALE,
|
||||||
duration: bounceUpTime,
|
duration: bounceUpTime,
|
||||||
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
|
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
|
||||||
delay: delay,
|
delay,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
let duration = ANIMATION_TIME_IN - bounceUpTime;
|
let duration = ANIMATION_TIME_IN - bounceUpTime;
|
||||||
actor.ease({
|
actor.ease({
|
||||||
|
@ -404,7 +404,7 @@ var Key = GObject.registerClass({
|
|||||||
_makeKey(key) {
|
_makeKey(key) {
|
||||||
let label = GLib.markup_escape_text(key, -1);
|
let label = GLib.markup_escape_text(key, -1);
|
||||||
let button = new St.Button({
|
let button = new St.Button({
|
||||||
label: label,
|
label,
|
||||||
style_class: 'keyboard-key',
|
style_class: 'keyboard-key',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
});
|
});
|
||||||
|
@ -445,7 +445,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
_createBackgroundManager(monitorIndex) {
|
_createBackgroundManager(monitorIndex) {
|
||||||
let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
|
let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
|
||||||
layoutManager: this,
|
layoutManager: this,
|
||||||
monitorIndex: monitorIndex });
|
monitorIndex });
|
||||||
|
|
||||||
bgManager.connect('changed', this._addBackgroundMenu.bind(this));
|
bgManager.connect('changed', this._addBackgroundMenu.bind(this));
|
||||||
this._addBackgroundMenu(bgManager);
|
this._addBackgroundMenu(bgManager);
|
||||||
@ -955,7 +955,7 @@ var 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: x, y: 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1026,7 +1026,7 @@ var 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: x, y: 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)
|
||||||
@ -1077,7 +1077,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
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: side });
|
let strut = new Meta.Strut({ rect: strutRect, side });
|
||||||
struts.push(strut);
|
struts.push(strut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,12 +86,12 @@ var AutoComplete = class AutoComplete {
|
|||||||
let currTime = global.get_current_time();
|
let currTime = global.get_current_time();
|
||||||
if ((currTime - this._lastTabTime) < AUTO_COMPLETE_DOUBLE_TAB_DELAY) {
|
if ((currTime - this._lastTabTime) < AUTO_COMPLETE_DOUBLE_TAB_DELAY) {
|
||||||
this._processCompletionRequest({ tabType: 'double',
|
this._processCompletionRequest({ tabType: 'double',
|
||||||
completions: completions,
|
completions,
|
||||||
attrHead: attrHead });
|
attrHead });
|
||||||
} else {
|
} else {
|
||||||
this._processCompletionRequest({ tabType: 'single',
|
this._processCompletionRequest({ tabType: 'single',
|
||||||
completions: completions,
|
completions,
|
||||||
attrHead: attrHead });
|
attrHead });
|
||||||
}
|
}
|
||||||
this._lastTabTime = currTime;
|
this._lastTabTime = currTime;
|
||||||
}
|
}
|
||||||
@ -141,9 +141,9 @@ var Notebook = GObject.registerClass({
|
|||||||
scrollview.get_hscroll_bar().hide();
|
scrollview.get_hscroll_bar().hide();
|
||||||
scrollview.add_actor(child);
|
scrollview.add_actor(child);
|
||||||
|
|
||||||
let tabData = { child: child,
|
let tabData = { child,
|
||||||
labelBox: labelBox,
|
labelBox,
|
||||||
label: label,
|
label,
|
||||||
scrollView: scrollview,
|
scrollView: scrollview,
|
||||||
_scrollToBottom: false };
|
_scrollToBottom: false };
|
||||||
this._tabs.push(tabData);
|
this._tabs.push(tabData);
|
||||||
|
@ -858,8 +858,8 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
* of the magnified view.
|
* of the magnified view.
|
||||||
*/
|
*/
|
||||||
setMagFactor(xMagFactor, yMagFactor) {
|
setMagFactor(xMagFactor, yMagFactor) {
|
||||||
this._changeROI({ xMagFactor: xMagFactor,
|
this._changeROI({ xMagFactor,
|
||||||
yMagFactor: yMagFactor,
|
yMagFactor,
|
||||||
redoCursorTracking: this._followingCursor });
|
redoCursorTracking: this._followingCursor });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,11 +490,11 @@ function pushModal(actor, params) {
|
|||||||
modalActorFocusStack[index].prevFocus = null;
|
modalActorFocusStack[index].prevFocus = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
modalActorFocusStack.push({ actor: actor,
|
modalActorFocusStack.push({ actor,
|
||||||
destroyId: actorDestroyId,
|
destroyId: actorDestroyId,
|
||||||
prevFocus: prevFocus,
|
prevFocus,
|
||||||
prevFocusDestroyId: prevFocusDestroyId,
|
prevFocusDestroyId,
|
||||||
actionMode: actionMode });
|
actionMode });
|
||||||
|
|
||||||
actionMode = params.actionMode;
|
actionMode = params.actionMode;
|
||||||
global.stage.set_key_focus(actor);
|
global.stage.set_key_focus(actor);
|
||||||
@ -687,8 +687,8 @@ function _queueBeforeRedraw(workId) {
|
|||||||
function initializeDeferredWork(actor, callback) {
|
function initializeDeferredWork(actor, callback) {
|
||||||
// Turn into a string so we can use as an object property
|
// Turn into a string so we can use as an object property
|
||||||
let workId = `${(++_deferredWorkSequence)}`;
|
let workId = `${(++_deferredWorkSequence)}`;
|
||||||
_deferredWorkData[workId] = { 'actor': actor,
|
_deferredWorkData[workId] = { actor,
|
||||||
'callback': callback };
|
callback };
|
||||||
actor.connect('notify::mapped', () => {
|
actor.connect('notify::mapped', () => {
|
||||||
if (!(actor.mapped && _deferredWorkQueue.includes(workId)))
|
if (!(actor.mapped && _deferredWorkQueue.includes(workId)))
|
||||||
return;
|
return;
|
||||||
|
@ -435,7 +435,7 @@ var 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: label, callback: callback });
|
this.actions.push({ label, callback });
|
||||||
}
|
}
|
||||||
|
|
||||||
get acknowledged() {
|
get acknowledged() {
|
||||||
@ -609,7 +609,7 @@ var NotificationBanner = GObject.registerClass({
|
|||||||
|
|
||||||
addAction(label, callback) {
|
addAction(label, callback) {
|
||||||
let button = new St.Button({ style_class: 'notification-button',
|
let button = new St.Button({ style_class: 'notification-button',
|
||||||
label: label,
|
label,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
can_focus: true });
|
can_focus: true });
|
||||||
|
|
||||||
@ -750,7 +750,7 @@ var Source = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}, class Source extends GObject.Object {
|
}, class Source extends GObject.Object {
|
||||||
_init(title, iconName) {
|
_init(title, iconName) {
|
||||||
super._init({ title: title });
|
super._init({ title });
|
||||||
|
|
||||||
this.SOURCE_ICON_SIZE = 48;
|
this.SOURCE_ICON_SIZE = 48;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ class MediaMessage extends MessageList.Message {
|
|||||||
|
|
||||||
if (this._player.trackCoverUrl) {
|
if (this._player.trackCoverUrl) {
|
||||||
let file = Gio.File.new_for_uri(this._player.trackCoverUrl);
|
let file = Gio.File.new_for_uri(this._player.trackCoverUrl);
|
||||||
this._icon.gicon = new Gio.FileIcon({ file: file });
|
this._icon.gicon = new Gio.FileIcon({ file });
|
||||||
this._icon.remove_style_class_name('fallback');
|
this._icon.remove_style_class_name('fallback');
|
||||||
} else {
|
} else {
|
||||||
this._icon.icon_name = 'audio-x-generic-symbolic';
|
this._icon.icon_name = 'audio-x-generic-symbolic';
|
||||||
|
@ -201,13 +201,13 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||||||
hints['image-data'] = hints['icon_data'];
|
hints['image-data'] = hints['icon_data'];
|
||||||
}
|
}
|
||||||
|
|
||||||
let ndata = { appName: appName,
|
let ndata = { appName,
|
||||||
icon: icon,
|
icon,
|
||||||
summary: summary,
|
summary,
|
||||||
body: body,
|
body,
|
||||||
actions: actions,
|
actions,
|
||||||
hints: hints,
|
hints,
|
||||||
timeout: timeout };
|
timeout };
|
||||||
if (replacesId != 0 && this._notifications[replacesId]) {
|
if (replacesId != 0 && this._notifications[replacesId]) {
|
||||||
ndata.id = id = replacesId;
|
ndata.id = id = replacesId;
|
||||||
ndata.notification = this._notifications[replacesId].notification;
|
ndata.notification = this._notifications[replacesId].notification;
|
||||||
@ -299,7 +299,7 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||||||
else if (!gicon)
|
else if (!gicon)
|
||||||
gicon = this._fallbackIconForNotificationData(hints);
|
gicon = this._fallbackIconForNotificationData(hints);
|
||||||
|
|
||||||
notification.update(summary, body, { gicon: gicon,
|
notification.update(summary, body, { gicon,
|
||||||
bannerMarkup: true,
|
bannerMarkup: true,
|
||||||
clear: true,
|
clear: true,
|
||||||
soundFile: hints['sound-file'],
|
soundFile: hints['sound-file'],
|
||||||
|
@ -462,7 +462,7 @@ class ControlsManager extends St.Widget {
|
|||||||
_updateWorkspacesGeometry() {
|
_updateWorkspacesGeometry() {
|
||||||
let [x, y] = this.get_transformed_position();
|
let [x, y] = this.get_transformed_position();
|
||||||
let [width, height] = this.get_transformed_size();
|
let [width, height] = this.get_transformed_size();
|
||||||
let geometry = { x: x, y: y, width: width, height: height };
|
let geometry = { x, y, width, height };
|
||||||
|
|
||||||
let spacing = this.get_theme_node().get_length('spacing');
|
let spacing = this.get_theme_node().get_length('spacing');
|
||||||
let dashWidth = this._dashSlider.getVisibleWidth() + spacing;
|
let dashWidth = this._dashSlider.getVisibleWidth() + spacing;
|
||||||
|
@ -57,8 +57,7 @@ function _unpremultiply(color) {
|
|||||||
let red = Math.min((color.red * 255 + 127) / color.alpha, 255);
|
let red = Math.min((color.red * 255 + 127) / color.alpha, 255);
|
||||||
let green = Math.min((color.green * 255 + 127) / color.alpha, 255);
|
let green = Math.min((color.green * 255 + 127) / color.alpha, 255);
|
||||||
let blue = Math.min((color.blue * 255 + 127) / color.alpha, 255);
|
let blue = Math.min((color.blue * 255 + 127) / color.alpha, 255);
|
||||||
return new Clutter.Color({ red: red, green: green,
|
return new Clutter.Color({ red, green, blue, alpha: color.alpha });
|
||||||
blue: blue, alpha: color.alpha });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppMenu extends PopupMenu.PopupMenu {
|
class AppMenu extends PopupMenu.PopupMenu {
|
||||||
|
@ -269,7 +269,7 @@ class PopupMenuItem extends PopupBaseMenuItem {
|
|||||||
_init(text, params) {
|
_init(text, params) {
|
||||||
super._init(params);
|
super._init(params);
|
||||||
|
|
||||||
this.label = new St.Label({ text: text });
|
this.label = new St.Label({ text });
|
||||||
this.add_child(this.label);
|
this.add_child(this.label);
|
||||||
this.label_actor = this.label;
|
this.label_actor = this.label;
|
||||||
}
|
}
|
||||||
@ -330,7 +330,7 @@ var PopupSwitchMenuItem = GObject.registerClass({
|
|||||||
_init(text, active, params) {
|
_init(text, active, params) {
|
||||||
super._init(params);
|
super._init(params);
|
||||||
|
|
||||||
this.label = new St.Label({ text: text });
|
this.label = new St.Label({ text });
|
||||||
this._switch = new Switch(active);
|
this._switch = new Switch(active);
|
||||||
|
|
||||||
this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
|
this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
|
||||||
@ -416,7 +416,7 @@ class PopupImageMenuItem extends PopupBaseMenuItem {
|
|||||||
this._icon = new St.Icon({ style_class: 'popup-menu-icon',
|
this._icon = new St.Icon({ style_class: 'popup-menu-icon',
|
||||||
x_align: Clutter.ActorAlign.END });
|
x_align: Clutter.ActorAlign.END });
|
||||||
this.add_child(this._icon);
|
this.add_child(this._icon);
|
||||||
this.label = new St.Label({ text: text });
|
this.label = new St.Label({ text });
|
||||||
this.add_child(this.label);
|
this.add_child(this.label);
|
||||||
this.label_actor = this.label;
|
this.label_actor = this.label;
|
||||||
|
|
||||||
@ -1129,7 +1129,7 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
|
|||||||
this.add_child(this.icon);
|
this.add_child(this.icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.label = new St.Label({ text: text,
|
this.label = new St.Label({ text,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER });
|
||||||
this.add_child(this.label);
|
this.add_child(this.label);
|
||||||
@ -1251,7 +1251,7 @@ var PopupMenuManager = class {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
let menudata = {
|
let menudata = {
|
||||||
menu: menu,
|
menu,
|
||||||
openStateChangeId: menu.connect('open-state-changed', this._onMenuOpenState.bind(this)),
|
openStateChangeId: menu.connect('open-state-changed', this._onMenuOpenState.bind(this)),
|
||||||
destroyId: menu.connect('destroy', this._onMenuDestroy.bind(this)),
|
destroyId: menu.connect('destroy', this._onMenuDestroy.bind(this)),
|
||||||
enterId: 0,
|
enterId: 0,
|
||||||
|
@ -228,8 +228,7 @@ var RemoteSearchProvider = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gicon)
|
if (gicon)
|
||||||
icon = new St.Icon({ gicon: gicon,
|
icon = new St.Icon({ gicon, icon_size: size });
|
||||||
icon_size: size });
|
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ var ScreenShield = class {
|
|||||||
height: monitor.height });
|
height: monitor.height });
|
||||||
|
|
||||||
let bgManager = new Background.BackgroundManager({ container: widget,
|
let bgManager = new Background.BackgroundManager({ container: widget,
|
||||||
monitorIndex: monitorIndex,
|
monitorIndex,
|
||||||
controlPosition: false,
|
controlPosition: false,
|
||||||
settingsSchema: SCREENSAVER_SCHEMA });
|
settingsSchema: SCREENSAVER_SCHEMA });
|
||||||
|
|
||||||
@ -1026,8 +1026,7 @@ var ScreenShield = class {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this._lockScreenGroup.fixed_position_set = false;
|
this._lockScreenGroup.fixed_position_set = false;
|
||||||
this._lockScreenShown({ fadeToBlack: fadeToBlack,
|
this._lockScreenShown({ fadeToBlack, animateFade: false });
|
||||||
animateFade: false });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._lockScreenGroup.grab_key_focus();
|
this._lockScreenGroup.grab_key_focus();
|
||||||
|
@ -252,7 +252,7 @@ var ScreenshotService = class {
|
|||||||
"Invalid params");
|
"Invalid params");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let flashspot = new Flashspot({ x: x, y: y, width: width, height: height });
|
let flashspot = new Flashspot({ x, y, width, height });
|
||||||
flashspot.fire();
|
flashspot.fire();
|
||||||
invocation.return_value(null);
|
invocation.return_value(null);
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ var InputSourceSystemSettings = class 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: id });
|
sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id });
|
||||||
}
|
}
|
||||||
return sourcesList;
|
return sourcesList;
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ var InputSourceSessionSettings = class extends InputSourceSettings {
|
|||||||
|
|
||||||
for (let i = 0; i < nSources; i++) {
|
for (let i = 0; i < nSources; i++) {
|
||||||
let [type, id] = sources.get_child_value(i).deep_unpack();
|
let [type, id] = sources.get_child_value(i).deep_unpack();
|
||||||
sourcesList.push({ type: type, id: id });
|
sourcesList.push({ type, id });
|
||||||
}
|
}
|
||||||
return sourcesList;
|
return sourcesList;
|
||||||
}
|
}
|
||||||
@ -562,14 +562,14 @@ var InputSourceManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (exists)
|
if (exists)
|
||||||
infosList.push({ type: type, id: id, displayName: displayName, shortName: 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: type, id: id, displayName: displayName, shortName: shortName });
|
infosList.push({ type, id, displayName, shortName });
|
||||||
}
|
}
|
||||||
|
|
||||||
let inputSourcesByShortName = {};
|
let inputSourcesByShortName = {};
|
||||||
|
@ -1710,7 +1710,7 @@ class Indicator extends PanelMenu.SystemIndicator {
|
|||||||
this._ensureSource();
|
this._ensureSource();
|
||||||
|
|
||||||
let gicon = new Gio.ThemedIcon({ name: iconName });
|
let gicon = new Gio.ThemedIcon({ name: iconName });
|
||||||
this._notification = new MessageTray.Notification(this._source, title, text, { gicon: gicon });
|
this._notification = new MessageTray.Notification(this._source, title, text, { gicon });
|
||||||
this._notification.setUrgency(urgency);
|
this._notification.setUrgency(urgency);
|
||||||
this._notification.setTransient(true);
|
this._notification.setTransient(true);
|
||||||
this._notification.connect('destroy', () => {
|
this._notification.connect('destroy', () => {
|
||||||
|
@ -95,7 +95,7 @@ var UnlockDialog = GObject.registerClass({
|
|||||||
userName = null;
|
userName = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._authPrompt.begin({ userName: userName });
|
this._authPrompt.begin({ userName });
|
||||||
}
|
}
|
||||||
|
|
||||||
_escape() {
|
_escape() {
|
||||||
|
@ -1466,7 +1466,7 @@ var WindowManager = class {
|
|||||||
this._resizePending.add(actor);
|
this._resizePending.add(actor);
|
||||||
actor.__animationInfo = { clone: actorClone,
|
actor.__animationInfo = { clone: actorClone,
|
||||||
oldRect: oldFrameRect,
|
oldRect: oldFrameRect,
|
||||||
destroyId: destroyId };
|
destroyId };
|
||||||
}
|
}
|
||||||
|
|
||||||
_sizeChangedWindow(shellwm, actor) {
|
_sizeChangedWindow(shellwm, actor) {
|
||||||
|
@ -1950,7 +1950,7 @@ class Workspace extends St.Widget {
|
|||||||
if (numColumns == lastLayout.numColumns)
|
if (numColumns == lastLayout.numColumns)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns };
|
let layout = { area, strategy, numRows, numColumns };
|
||||||
strategy.computeLayout(windows, layout);
|
strategy.computeLayout(windows, layout);
|
||||||
strategy.computeScaleAndSpace(layout);
|
strategy.computeScaleAndSpace(layout);
|
||||||
|
|
||||||
|
@ -697,7 +697,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: x, y: 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,7 +766,7 @@ class WorkspacesDisplay extends St.Widget {
|
|||||||
let allocation = this.allocation;
|
let allocation = this.allocation;
|
||||||
let width = allocation.x2 - allocation.x1;
|
let width = allocation.x2 - allocation.x1;
|
||||||
let height = allocation.y2 - allocation.y1;
|
let height = allocation.y2 - allocation.y1;
|
||||||
let primaryGeometry = { x: x, y: y, width: width, height: height };
|
let primaryGeometry = { x, y, width, height };
|
||||||
|
|
||||||
let monitors = Main.layoutManager.monitors;
|
let monitors = Main.layoutManager.monitors;
|
||||||
for (let i = 0; i < monitors.length; i++) {
|
for (let i = 0; i < monitors.length; i++) {
|
||||||
|
@ -84,8 +84,8 @@ var XdndHandler = class {
|
|||||||
Main.uiGroup.set_child_above_sibling(this._cursorWindowClone, null);
|
Main.uiGroup.set_child_above_sibling(this._cursorWindowClone, null);
|
||||||
|
|
||||||
let dragEvent = {
|
let dragEvent = {
|
||||||
x: x,
|
x,
|
||||||
y: y,
|
y,
|
||||||
dragActor: this._cursorWindowClone ? this._cursorWindowClone : this._dummy,
|
dragActor: this._cursorWindowClone ? this._cursorWindowClone : this._dummy,
|
||||||
source: this,
|
source: this,
|
||||||
targetActor: pickedActor
|
targetActor: pickedActor
|
||||||
|
Loading…
Reference in New Issue
Block a user