cleanup: Use new indentation style for object literals
We have made good progress on object literals as well, although there are still a lot that use the old style, given how ubiquitous object literals are. But the needed reindentation isn't overly intrusive, as changes are limited to the object literals themselves (i.e. they don't affect surrounding code). And given that object literals account for quite a bit of the remaining differences between regular and legacy rules, doing the transition now is still worthwhile. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>
This commit is contained in:
parent
ac9fbe92e5
commit
2b45a01517
@ -653,8 +653,10 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
begin(params) {
|
begin(params) {
|
||||||
params = Params.parse(params, { userName: null,
|
params = Params.parse(params, {
|
||||||
hold: null });
|
userName: null,
|
||||||
|
hold: null,
|
||||||
|
});
|
||||||
|
|
||||||
this.updateSensitivity(false);
|
this.updateSensitivity(false);
|
||||||
|
|
||||||
|
@ -17,8 +17,10 @@
|
|||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { AccountsService, Atk, Clutter, Gdm, Gio,
|
const {
|
||||||
GLib, GObject, Meta, Pango, Shell, St } = imports.gi;
|
AccountsService, Atk, Clutter, Gdm, Gio,
|
||||||
|
GLib, GObject, Meta, Pango, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
|
|
||||||
const AuthPrompt = imports.gdm.authPrompt;
|
const AuthPrompt = imports.gdm.authPrompt;
|
||||||
const Batch = imports.gdm.batch;
|
const Batch = imports.gdm.batch;
|
||||||
@ -67,9 +69,11 @@ var UserListItem = GObject.registerClass({
|
|||||||
this._userWidget.bind_property('label-actor', this, 'label-actor',
|
this._userWidget.bind_property('label-actor', this, 'label-actor',
|
||||||
GObject.BindingFlags.SYNC_CREATE);
|
GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
|
||||||
this._timedLoginIndicator = new St.Bin({ style_class: 'login-dialog-timed-login-indicator',
|
this._timedLoginIndicator = new St.Bin({
|
||||||
|
style_class: 'login-dialog-timed-login-indicator',
|
||||||
scale_x: 0,
|
scale_x: 0,
|
||||||
visible: false });
|
visible: false,
|
||||||
|
});
|
||||||
layout.add(this._timedLoginIndicator);
|
layout.add(this._timedLoginIndicator);
|
||||||
|
|
||||||
this._onUserChanged();
|
this._onUserChanged();
|
||||||
@ -167,9 +171,11 @@ var UserList = GObject.registerClass({
|
|||||||
this.set_policy(St.PolicyType.NEVER,
|
this.set_policy(St.PolicyType.NEVER,
|
||||||
St.PolicyType.AUTOMATIC);
|
St.PolicyType.AUTOMATIC);
|
||||||
|
|
||||||
this._box = new St.BoxLayout({ vertical: true,
|
this._box = new St.BoxLayout({
|
||||||
|
vertical: true,
|
||||||
style_class: 'login-dialog-user-list',
|
style_class: 'login-dialog-user-list',
|
||||||
pseudo_class: 'expanded' });
|
pseudo_class: 'expanded',
|
||||||
|
});
|
||||||
|
|
||||||
this.add_actor(this._box);
|
this.add_actor(this._box);
|
||||||
this._items = {};
|
this._items = {};
|
||||||
@ -438,11 +444,13 @@ var LoginDialog = GObject.registerClass({
|
|||||||
this._updateLogoTextureId = this._textureCache.connect('texture-file-changed',
|
this._updateLogoTextureId = this._textureCache.connect('texture-file-changed',
|
||||||
this._updateLogoTexture.bind(this));
|
this._updateLogoTexture.bind(this));
|
||||||
|
|
||||||
this._userSelectionBox = new St.BoxLayout({ style_class: 'login-dialog-user-selection-box',
|
this._userSelectionBox = new St.BoxLayout({
|
||||||
|
style_class: 'login-dialog-user-selection-box',
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
vertical: true,
|
vertical: true,
|
||||||
visible: false });
|
visible: false,
|
||||||
|
});
|
||||||
this.add_child(this._userSelectionBox);
|
this.add_child(this._userSelectionBox);
|
||||||
|
|
||||||
this._userList = new UserList();
|
this._userList = new UserList();
|
||||||
@ -477,17 +485,21 @@ var LoginDialog = GObject.registerClass({
|
|||||||
|
|
||||||
this._userSelectionBox.add_child(this._notListedButton);
|
this._userSelectionBox.add_child(this._notListedButton);
|
||||||
|
|
||||||
this._bannerView = new St.ScrollView({ style_class: 'login-dialog-banner-view',
|
this._bannerView = new St.ScrollView({
|
||||||
|
style_class: 'login-dialog-banner-view',
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
vscrollbar_policy: St.PolicyType.AUTOMATIC,
|
vscrollbar_policy: St.PolicyType.AUTOMATIC,
|
||||||
hscrollbar_policy: St.PolicyType.NEVER });
|
hscrollbar_policy: St.PolicyType.NEVER,
|
||||||
|
});
|
||||||
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({ style_class: 'login-dialog-banner',
|
this._bannerLabel = new St.Label({
|
||||||
text: '' });
|
style_class: 'login-dialog-banner',
|
||||||
|
text: '',
|
||||||
|
});
|
||||||
this._bannerLabel.clutter_text.line_wrap = true;
|
this._bannerLabel.clutter_text.line_wrap = true;
|
||||||
this._bannerLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._bannerLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
bannerBox.add_child(this._bannerLabel);
|
bannerBox.add_child(this._bannerLabel);
|
||||||
@ -502,9 +514,11 @@ var LoginDialog = GObject.registerClass({
|
|||||||
this._sessionMenuButton.show();
|
this._sessionMenuButton.show();
|
||||||
this.add_child(this._sessionMenuButton);
|
this.add_child(this._sessionMenuButton);
|
||||||
|
|
||||||
this._logoBin = new St.Widget({ style_class: 'login-dialog-logo-bin',
|
this._logoBin = new St.Widget({
|
||||||
|
style_class: 'login-dialog-logo-bin',
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.END });
|
y_align: Clutter.ActorAlign.END,
|
||||||
|
});
|
||||||
this._logoBin.connect('resource-scale-changed', () => {
|
this._logoBin.connect('resource-scale-changed', () => {
|
||||||
this._updateLogoTexture(this._textureCache, this._logoFile);
|
this._updateLogoTexture(this._textureCache, this._logoFile);
|
||||||
});
|
});
|
||||||
|
@ -21,12 +21,14 @@ const OVirtCredentialsInfo = Gio.DBusInterfaceInfo.new_for_xml(OVirtCredentialsI
|
|||||||
let _oVirtCredentialsManager = null;
|
let _oVirtCredentialsManager = null;
|
||||||
|
|
||||||
function OVirtCredentials() {
|
function OVirtCredentials() {
|
||||||
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.system,
|
var self = new Gio.DBusProxy({
|
||||||
|
g_connection: Gio.DBus.system,
|
||||||
g_interface_name: OVirtCredentialsInfo.name,
|
g_interface_name: OVirtCredentialsInfo.name,
|
||||||
g_interface_info: OVirtCredentialsInfo,
|
g_interface_info: OVirtCredentialsInfo,
|
||||||
g_name: 'org.ovirt.vdsm.Credentials',
|
g_name: 'org.ovirt.vdsm.Credentials',
|
||||||
g_object_path: '/org/ovirt/vdsm/Credentials',
|
g_object_path: '/org/ovirt/vdsm/Credentials',
|
||||||
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES });
|
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES,
|
||||||
|
});
|
||||||
self.init(null);
|
self.init(null);
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,10 @@ function cloneAndFadeOutActor(actor) {
|
|||||||
// and reveals its sibling.
|
// and reveals its sibling.
|
||||||
actor.hide();
|
actor.hide();
|
||||||
|
|
||||||
let clone = new Clutter.Clone({ source: actor,
|
const clone = new Clutter.Clone({
|
||||||
reactive: false });
|
source: actor,
|
||||||
|
reactive: false,
|
||||||
|
});
|
||||||
|
|
||||||
Main.uiGroup.add_child(clone);
|
Main.uiGroup.add_child(clone);
|
||||||
|
|
||||||
|
@ -24,12 +24,14 @@ const VmwareCredentialsInfo = Gio.DBusInterfaceInfo.new_for_xml(VmwareCredential
|
|||||||
let _vmwareCredentialsManager = null;
|
let _vmwareCredentialsManager = null;
|
||||||
|
|
||||||
function VmwareCredentials() {
|
function VmwareCredentials() {
|
||||||
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
|
var self = new Gio.DBusProxy({
|
||||||
|
g_connection: Gio.DBus.session,
|
||||||
g_interface_name: VmwareCredentialsInfo.name,
|
g_interface_name: VmwareCredentialsInfo.name,
|
||||||
g_interface_info: VmwareCredentialsInfo,
|
g_interface_info: VmwareCredentialsInfo,
|
||||||
g_name: dbusInterface,
|
g_name: dbusInterface,
|
||||||
g_object_path: dbusPath,
|
g_object_path: dbusPath,
|
||||||
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES });
|
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES,
|
||||||
|
});
|
||||||
self.init(null);
|
self.init(null);
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,11 @@ var DEFAULT_LIMIT = 512;
|
|||||||
|
|
||||||
var HistoryManager = class {
|
var HistoryManager = class {
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
params = Params.parse(params, { gsettingsKey: null,
|
params = Params.parse(params, {
|
||||||
|
gsettingsKey: null,
|
||||||
limit: DEFAULT_LIMIT,
|
limit: DEFAULT_LIMIT,
|
||||||
entry: null });
|
entry: null,
|
||||||
|
});
|
||||||
|
|
||||||
this._key = params.gsettingsKey;
|
this._key = params.gsettingsKey;
|
||||||
this._limit = params.limit;
|
this._limit = params.limit;
|
||||||
|
@ -27,24 +27,28 @@ const ObjectManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(ObjectManagerIface);
|
|||||||
|
|
||||||
var ObjectManager = class {
|
var ObjectManager = class {
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
params = Params.parse(params, { connection: null,
|
params = Params.parse(params, {
|
||||||
|
connection: null,
|
||||||
name: null,
|
name: null,
|
||||||
objectPath: null,
|
objectPath: null,
|
||||||
knownInterfaces: null,
|
knownInterfaces: null,
|
||||||
cancellable: null,
|
cancellable: null,
|
||||||
onLoaded: null });
|
onLoaded: null,
|
||||||
|
});
|
||||||
|
|
||||||
this._connection = params.connection;
|
this._connection = params.connection;
|
||||||
this._serviceName = params.name;
|
this._serviceName = params.name;
|
||||||
this._managerPath = params.objectPath;
|
this._managerPath = params.objectPath;
|
||||||
this._cancellable = params.cancellable;
|
this._cancellable = params.cancellable;
|
||||||
|
|
||||||
this._managerProxy = new Gio.DBusProxy({ g_connection: this._connection,
|
this._managerProxy = new Gio.DBusProxy({
|
||||||
|
g_connection: this._connection,
|
||||||
g_interface_name: ObjectManagerInfo.name,
|
g_interface_name: ObjectManagerInfo.name,
|
||||||
g_interface_info: ObjectManagerInfo,
|
g_interface_info: ObjectManagerInfo,
|
||||||
g_name: this._serviceName,
|
g_name: this._serviceName,
|
||||||
g_object_path: this._managerPath,
|
g_object_path: this._managerPath,
|
||||||
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
|
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START,
|
||||||
|
});
|
||||||
|
|
||||||
this._interfaceInfos = {};
|
this._interfaceInfos = {};
|
||||||
this._objects = {};
|
this._objects = {};
|
||||||
@ -80,12 +84,14 @@ var ObjectManager = class {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let proxy = new Gio.DBusProxy({ g_connection: this._connection,
|
const proxy = new Gio.DBusProxy({
|
||||||
|
g_connection: this._connection,
|
||||||
g_name: this._serviceName,
|
g_name: this._serviceName,
|
||||||
g_object_path: objectPath,
|
g_object_path: objectPath,
|
||||||
g_interface_name: interfaceName,
|
g_interface_name: interfaceName,
|
||||||
g_interface_info: info,
|
g_interface_info: info,
|
||||||
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
|
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START,
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable);
|
await proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable);
|
||||||
|
@ -27,11 +27,13 @@ function getSmartcardManager() {
|
|||||||
|
|
||||||
var SmartcardManager = class {
|
var SmartcardManager = class {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._objectManager = new ObjectManager.ObjectManager({ connection: Gio.DBus.session,
|
this._objectManager = new ObjectManager.ObjectManager({
|
||||||
name: "org.gnome.SettingsDaemon.Smartcard",
|
connection: Gio.DBus.session,
|
||||||
|
name: 'org.gnome.SettingsDaemon.Smartcard',
|
||||||
objectPath: '/org/gnome/SettingsDaemon/Smartcard',
|
objectPath: '/org/gnome/SettingsDaemon/Smartcard',
|
||||||
knownInterfaces: [SmartcardTokenIface],
|
knownInterfaces: [SmartcardTokenIface],
|
||||||
onLoaded: this._onLoaded.bind(this) });
|
onLoaded: this._onLoaded.bind(this),
|
||||||
|
});
|
||||||
this._insertedTokens = {};
|
this._insertedTokens = {};
|
||||||
this._loginToken = null;
|
this._loginToken = null;
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,10 @@ function trySpawn(argv) {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
/* Rewrite the error in case of ENOENT */
|
/* Rewrite the error in case of ENOENT */
|
||||||
if (err.matches(GLib.SpawnError, GLib.SpawnError.NOENT)) {
|
if (err.matches(GLib.SpawnError, GLib.SpawnError.NOENT)) {
|
||||||
throw new GLib.SpawnError({ code: GLib.SpawnError.NOENT,
|
throw new GLib.SpawnError({
|
||||||
message: _("Command not found") });
|
code: GLib.SpawnError.NOENT,
|
||||||
|
message: _('Command not found'),
|
||||||
|
});
|
||||||
} else if (err instanceof GLib.Error) {
|
} else if (err instanceof GLib.Error) {
|
||||||
// The exception from gjs contains an error string like:
|
// The exception from gjs contains an error string like:
|
||||||
// Error invoking GLib.spawn_command_line_async: Failed to
|
// Error invoking GLib.spawn_command_line_async: Failed to
|
||||||
|
135
js/perf/core.js
135
js/perf/core.js
@ -16,59 +16,86 @@ const Scripting = imports.ui.scripting;
|
|||||||
// on a particular system.
|
// on a particular system.
|
||||||
|
|
||||||
var METRICS = {
|
var METRICS = {
|
||||||
overviewLatencyFirst:
|
overviewLatencyFirst: {
|
||||||
{ description: "Time to first frame after triggering overview, first time",
|
description: 'Time to first frame after triggering overview, first time',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
overviewFpsFirst:
|
},
|
||||||
{ description: "Frame rate when going to the overview, first time",
|
overviewFpsFirst: {
|
||||||
units: "frames / s" },
|
description: 'Frame rate when going to the overview, first time',
|
||||||
overviewLatencySubsequent:
|
units: 'frames / s',
|
||||||
{ description: "Time to first frame after triggering overview, second time",
|
},
|
||||||
units: "us" },
|
overviewLatencySubsequent: {
|
||||||
overviewFpsSubsequent:
|
description: 'Time to first frame after triggering overview, second time',
|
||||||
{ description: "Frames rate when going to the overview, second time",
|
units: 'us',
|
||||||
units: "frames / s" },
|
},
|
||||||
overviewFps5Windows:
|
overviewFpsSubsequent: {
|
||||||
{ description: "Frames rate when going to the overview, 5 windows open",
|
description: 'Frames rate when going to the overview, second time',
|
||||||
units: "frames / s" },
|
units: 'frames / s',
|
||||||
overviewFps10Windows:
|
},
|
||||||
{ description: "Frames rate when going to the overview, 10 windows open",
|
overviewFps5Windows: {
|
||||||
units: "frames / s" },
|
description: 'Frames rate when going to the overview, 5 windows open',
|
||||||
overviewFps5Maximized:
|
units: 'frames / s',
|
||||||
{ description: "Frames rate when going to the overview, 5 maximized windows open",
|
},
|
||||||
units: "frames / s" },
|
overviewFps10Windows: {
|
||||||
overviewFps10Maximized:
|
description: 'Frames rate when going to the overview, 10 windows open',
|
||||||
{ description: "Frames rate when going to the overview, 10 maximized windows open",
|
units: 'frames / s',
|
||||||
units: "frames / s" },
|
},
|
||||||
overviewFps5Alpha:
|
overviewFps5Maximized: {
|
||||||
{ description: "Frames rate when going to the overview, 5 alpha-transparent windows open",
|
description: 'Frames rate when going to the overview, 5 maximized windows open',
|
||||||
units: "frames / s" },
|
units: 'frames / s',
|
||||||
overviewFps10Alpha:
|
},
|
||||||
{ description: "Frames rate when going to the overview, 10 alpha-transparent windows open",
|
overviewFps10Maximized: {
|
||||||
units: "frames / s" },
|
description: 'Frames rate when going to the overview, 10 maximized windows open',
|
||||||
usedAfterOverview:
|
units: 'frames / s',
|
||||||
{ description: "Malloc'ed bytes after the overview is shown once",
|
},
|
||||||
units: "B" },
|
overviewFps5Alpha: {
|
||||||
leakedAfterOverview:
|
description: 'Frames rate when going to the overview, 5 alpha-transparent windows open',
|
||||||
{ description: "Additional malloc'ed bytes the second time the overview is shown",
|
units: 'frames / s',
|
||||||
units: "B" },
|
},
|
||||||
applicationsShowTimeFirst:
|
overviewFps10Alpha: {
|
||||||
{ description: "Time to switch to applications view, first time",
|
description: 'Frames rate when going to the overview, 10 alpha-transparent windows open',
|
||||||
units: "us" },
|
units: 'frames / s',
|
||||||
applicationsShowTimeSubsequent:
|
},
|
||||||
{ description: "Time to switch to applications view, second time",
|
usedAfterOverview: {
|
||||||
units: "us" },
|
description: "Malloc'ed bytes after the overview is shown once",
|
||||||
|
units: 'B',
|
||||||
|
},
|
||||||
|
leakedAfterOverview: {
|
||||||
|
description: "Additional malloc'ed bytes the second time the overview is shown",
|
||||||
|
units: 'B',
|
||||||
|
},
|
||||||
|
applicationsShowTimeFirst: {
|
||||||
|
description: 'Time to switch to applications view, first time',
|
||||||
|
units: 'us',
|
||||||
|
},
|
||||||
|
applicationsShowTimeSubsequent: {
|
||||||
|
description: 'Time to switch to applications view, second time',
|
||||||
|
units: 'us',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let WINDOW_CONFIGS = [
|
const WINDOW_CONFIGS = [{
|
||||||
{ width: 640, height: 480, alpha: false, maximized: false, count: 1, metric: 'overviewFpsSubsequent' },
|
width: 640, height: 480,
|
||||||
{ width: 640, height: 480, alpha: false, maximized: false, count: 5, metric: 'overviewFps5Windows' },
|
alpha: false, maximized: false, count: 1, metric: 'overviewFpsSubsequent',
|
||||||
{ width: 640, height: 480, alpha: false, maximized: false, count: 10, metric: 'overviewFps10Windows' },
|
}, {
|
||||||
{ width: 640, height: 480, alpha: false, maximized: true, count: 5, metric: 'overviewFps5Maximized' },
|
width: 640, height: 480,
|
||||||
{ width: 640, height: 480, alpha: false, maximized: true, count: 10, metric: 'overviewFps10Maximized' },
|
alpha: false, maximized: false, count: 5, metric: 'overviewFps5Windows',
|
||||||
{ width: 640, height: 480, alpha: true, maximized: false, count: 5, metric: 'overviewFps5Alpha' },
|
}, {
|
||||||
{ width: 640, height: 480, alpha: true, maximized: false, count: 10, metric: 'overviewFps10Alpha' },
|
width: 640, height: 480,
|
||||||
];
|
alpha: false, maximized: false, count: 10, metric: 'overviewFps10Windows',
|
||||||
|
}, {
|
||||||
|
width: 640, height: 480,
|
||||||
|
alpha: false, maximized: true, count: 5, metric: 'overviewFps5Maximized',
|
||||||
|
}, {
|
||||||
|
width: 640, height: 480,
|
||||||
|
alpha: false, maximized: true, count: 10, metric: 'overviewFps10Maximized',
|
||||||
|
}, {
|
||||||
|
width: 640, height: 480,
|
||||||
|
alpha: true, maximized: false, count: 5, metric: 'overviewFps5Alpha',
|
||||||
|
}, {
|
||||||
|
width: 640, height: 480,
|
||||||
|
alpha: true, maximized: false, count: 10, metric: 'overviewFps10Alpha',
|
||||||
|
}];
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
/* eslint-disable no-await-in-loop */
|
/* eslint-disable no-await-in-loop */
|
||||||
@ -96,10 +123,12 @@ async function run() {
|
|||||||
await Scripting.destroyTestWindows();
|
await Scripting.destroyTestWindows();
|
||||||
|
|
||||||
for (let k = 0; k < config.count; k++) {
|
for (let k = 0; k < config.count; k++) {
|
||||||
await Scripting.createTestWindow({ width: config.width,
|
await Scripting.createTestWindow({
|
||||||
|
width: config.width,
|
||||||
height: config.height,
|
height: config.height,
|
||||||
alpha: config.alpha,
|
alpha: config.alpha,
|
||||||
maximized: config.maximized });
|
maximized: config.maximized,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await Scripting.waitTestWindows();
|
await Scripting.waitTestWindows();
|
||||||
|
@ -12,33 +12,40 @@ const Main = imports.ui.main;
|
|||||||
const Scripting = imports.ui.scripting;
|
const Scripting = imports.ui.scripting;
|
||||||
|
|
||||||
var METRICS = {
|
var METRICS = {
|
||||||
timeToDesktop:
|
timeToDesktop: {
|
||||||
{ description: "Time from starting graphical.target to desktop showing",
|
description: 'Time from starting graphical.target to desktop showing',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
|
},
|
||||||
|
|
||||||
overviewShowTime:
|
overviewShowTime: {
|
||||||
{ description: "Time to switch to overview view, first time",
|
description: 'Time to switch to overview view, first time',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
|
},
|
||||||
|
|
||||||
applicationsShowTime:
|
applicationsShowTime: {
|
||||||
{ description: "Time to switch to applications view, first time",
|
description: 'Time to switch to applications view, first time',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
|
},
|
||||||
|
|
||||||
mainViewRedrawTime:
|
mainViewRedrawTime: {
|
||||||
{ description: "Time to redraw the main view, full screen",
|
description: 'Time to redraw the main view, full screen',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
|
},
|
||||||
|
|
||||||
overviewRedrawTime:
|
overviewRedrawTime: {
|
||||||
{ description: "Time to redraw the overview, full screen, 5 windows",
|
description: 'Time to redraw the overview, full screen, 5 windows',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
|
},
|
||||||
|
|
||||||
applicationRedrawTime:
|
applicationRedrawTime: {
|
||||||
{ description: "Time to redraw frame with a maximized application update",
|
description: 'Time to redraw frame with a maximized application update',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
|
},
|
||||||
|
|
||||||
geditStartTime:
|
geditStartTime: {
|
||||||
{ description: "Time from gedit launch to window drawn",
|
description: 'Time from gedit launch to window drawn',
|
||||||
units: "us" },
|
units: 'us',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function waitAndDraw(milliseconds) {
|
function waitAndDraw(milliseconds) {
|
||||||
@ -168,8 +175,10 @@ async function run() {
|
|||||||
await Scripting.destroyTestWindows();
|
await Scripting.destroyTestWindows();
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
|
|
||||||
await Scripting.createTestWindow({ maximized: true,
|
await Scripting.createTestWindow({
|
||||||
redraws: true });
|
maximized: true,
|
||||||
|
redraws: true,
|
||||||
|
});
|
||||||
await Scripting.waitTestWindows();
|
await Scripting.waitTestWindows();
|
||||||
|
|
||||||
await Scripting.sleep(1000);
|
await Scripting.sleep(1000);
|
||||||
|
@ -42,34 +42,44 @@ class PortalHeaderBar extends Gtk.HeaderBar {
|
|||||||
super._init({ show_close_button: true });
|
super._init({ show_close_button: true });
|
||||||
|
|
||||||
// See ephy-title-box.c in epiphany for the layout
|
// See ephy-title-box.c in epiphany for the layout
|
||||||
let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
|
const vbox = new Gtk.Box({
|
||||||
spacing: 0 });
|
orientation: Gtk.Orientation.VERTICAL,
|
||||||
|
spacing: 0,
|
||||||
|
});
|
||||||
this.set_custom_title(vbox);
|
this.set_custom_title(vbox);
|
||||||
|
|
||||||
/* TRANSLATORS: this is the title of the wifi captive portal login window */
|
/* TRANSLATORS: this is the title of the wifi captive portal login window */
|
||||||
let titleLabel = new Gtk.Label({ label: _("Hotspot Login"),
|
const titleLabel = new Gtk.Label({
|
||||||
|
label: _('Hotspot Login'),
|
||||||
wrap: false,
|
wrap: false,
|
||||||
single_line_mode: true,
|
single_line_mode: true,
|
||||||
ellipsize: Pango.EllipsizeMode.END });
|
ellipsize: Pango.EllipsizeMode.END,
|
||||||
|
});
|
||||||
titleLabel.get_style_context().add_class('title');
|
titleLabel.get_style_context().add_class('title');
|
||||||
vbox.add(titleLabel);
|
vbox.add(titleLabel);
|
||||||
|
|
||||||
let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
|
const hbox = new Gtk.Box({
|
||||||
|
orientation: Gtk.Orientation.HORIZONTAL,
|
||||||
spacing: 4,
|
spacing: 4,
|
||||||
halign: Gtk.Align.CENTER,
|
halign: Gtk.Align.CENTER,
|
||||||
valign: Gtk.Align.BASELINE });
|
valign: Gtk.Align.BASELINE,
|
||||||
|
});
|
||||||
hbox.get_style_context().add_class('subtitle');
|
hbox.get_style_context().add_class('subtitle');
|
||||||
vbox.add(hbox);
|
vbox.add(hbox);
|
||||||
|
|
||||||
this._lockImage = new Gtk.Image({ icon_size: Gtk.IconSize.MENU,
|
this._lockImage = new Gtk.Image({
|
||||||
valign: Gtk.Align.BASELINE });
|
icon_size: Gtk.IconSize.MENU,
|
||||||
|
valign: Gtk.Align.BASELINE,
|
||||||
|
});
|
||||||
hbox.add(this._lockImage);
|
hbox.add(this._lockImage);
|
||||||
|
|
||||||
this.subtitleLabel = new Gtk.Label({ wrap: false,
|
this.subtitleLabel = new Gtk.Label({
|
||||||
|
wrap: false,
|
||||||
single_line_mode: true,
|
single_line_mode: true,
|
||||||
ellipsize: Pango.EllipsizeMode.END,
|
ellipsize: Pango.EllipsizeMode.END,
|
||||||
valign: Gtk.Align.BASELINE,
|
valign: Gtk.Align.BASELINE,
|
||||||
selectable: true });
|
selectable: true,
|
||||||
|
});
|
||||||
this.subtitleLabel.get_style_context().add_class('subtitle');
|
this.subtitleLabel.get_style_context().add_class('subtitle');
|
||||||
hbox.add(this.subtitleLabel);
|
hbox.add(this.subtitleLabel);
|
||||||
|
|
||||||
@ -271,9 +281,11 @@ class PortalWindow extends Gtk.ApplicationWindow {
|
|||||||
var WebPortalHelper = GObject.registerClass(
|
var WebPortalHelper = GObject.registerClass(
|
||||||
class WebPortalHelper extends Gtk.Application {
|
class WebPortalHelper extends Gtk.Application {
|
||||||
_init() {
|
_init() {
|
||||||
super._init({ application_id: 'org.gnome.Shell.PortalHelper',
|
super._init({
|
||||||
|
application_id: 'org.gnome.Shell.PortalHelper',
|
||||||
flags: Gio.ApplicationFlags.IS_SERVICE,
|
flags: Gio.ApplicationFlags.IS_SERVICE,
|
||||||
inactivity_timeout: 30000 });
|
inactivity_timeout: 30000,
|
||||||
|
});
|
||||||
|
|
||||||
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(HelperDBusInterface, this);
|
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(HelperDBusInterface, this);
|
||||||
this._queue = [];
|
this._queue = [];
|
||||||
|
@ -64,15 +64,15 @@ class AccessDialog extends ModalDialog.ModalDialog {
|
|||||||
});
|
});
|
||||||
content.add_child(bodyLabel);
|
content.add_child(bodyLabel);
|
||||||
|
|
||||||
this.addButton({ label: denyLabel,
|
this.addButton({
|
||||||
action: () => {
|
label: denyLabel,
|
||||||
this._sendResponse(DialogResponse.CANCEL);
|
action: () => this._sendResponse(DialogResponse.CANCEL),
|
||||||
},
|
key: Clutter.KEY_Escape,
|
||||||
key: Clutter.KEY_Escape });
|
});
|
||||||
this.addButton({ label: grantLabel,
|
this.addButton({
|
||||||
action: () => {
|
label: grantLabel,
|
||||||
this._sendResponse(DialogResponse.OK);
|
action: () => this._sendResponse(DialogResponse.OK),
|
||||||
} });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
|
@ -28,14 +28,16 @@ var AppIconMode = {
|
|||||||
function _createWindowClone(window, size) {
|
function _createWindowClone(window, size) {
|
||||||
let [width, height] = window.get_size();
|
let [width, height] = window.get_size();
|
||||||
let scale = Math.min(1.0, size / width, size / height);
|
let scale = Math.min(1.0, size / width, size / height);
|
||||||
return new Clutter.Clone({ source: window,
|
return new Clutter.Clone({
|
||||||
|
source: window,
|
||||||
width: width * scale,
|
width: width * scale,
|
||||||
height: height * scale,
|
height: height * scale,
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
// usual hack for the usual bug in ClutterBinLayout...
|
// usual hack for the usual bug in ClutterBinLayout...
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true });
|
y_expand: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWindows(workspace) {
|
function getWindows(workspace) {
|
||||||
@ -462,10 +464,12 @@ class CyclerHighlight extends St.Widget {
|
|||||||
// We don't show an actual popup, so just provide what SwitcherPopup
|
// We don't show an actual popup, so just provide what SwitcherPopup
|
||||||
// expects instead of inheriting from SwitcherList
|
// expects instead of inheriting from SwitcherList
|
||||||
var CyclerList = GObject.registerClass({
|
var CyclerList = GObject.registerClass({
|
||||||
Signals: { 'item-activated': { param_types: [GObject.TYPE_INT] },
|
Signals: {
|
||||||
|
'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) {
|
||||||
this.emit('item-highlighted', index);
|
this.emit('item-highlighted', index);
|
||||||
@ -653,8 +657,10 @@ class WindowCyclerPopup extends CyclerPopup {
|
|||||||
var AppIcon = GObject.registerClass(
|
var AppIcon = GObject.registerClass(
|
||||||
class AppIcon extends St.BoxLayout {
|
class AppIcon extends St.BoxLayout {
|
||||||
_init(app) {
|
_init(app) {
|
||||||
super._init({ style_class: 'alt-tab-app',
|
super._init({
|
||||||
vertical: true });
|
style_class: 'alt-tab-app',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
|
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.icon = null;
|
this.icon = null;
|
||||||
@ -904,8 +910,10 @@ class ThumbnailSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
this._windows = windows;
|
this._windows = windows;
|
||||||
|
|
||||||
for (let i = 0; i < windows.length; i++) {
|
for (let i = 0; i < windows.length; i++) {
|
||||||
let box = new St.BoxLayout({ style_class: 'thumbnail-box',
|
const box = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'thumbnail-box',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
|
|
||||||
let bin = new St.Bin({ style_class: 'thumbnail' });
|
let bin = new St.Bin({ style_class: 'thumbnail' });
|
||||||
|
|
||||||
@ -991,8 +999,10 @@ class ThumbnailSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
var WindowIcon = GObject.registerClass(
|
var WindowIcon = GObject.registerClass(
|
||||||
class WindowIcon extends St.BoxLayout {
|
class WindowIcon extends St.BoxLayout {
|
||||||
_init(window, mode) {
|
_init(window, mode) {
|
||||||
super._init({ style_class: 'alt-tab-app',
|
super._init({
|
||||||
vertical: true });
|
style_class: 'alt-tab-app',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
|
|
||||||
this.window = window;
|
this.window = window;
|
||||||
|
|
||||||
@ -1051,8 +1061,10 @@ class WindowSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
_init(windows, mode) {
|
_init(windows, mode) {
|
||||||
super._init(true);
|
super._init(true);
|
||||||
|
|
||||||
this._label = new St.Label({ x_align: Clutter.ActorAlign.CENTER,
|
this._label = new St.Label({
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this.add_actor(this._label);
|
this.add_actor(this._label);
|
||||||
|
|
||||||
this.windows = windows;
|
this.windows = windows;
|
||||||
|
@ -2352,8 +2352,10 @@ var FolderIcon = GObject.registerClass({
|
|||||||
this._name = '';
|
this._name = '';
|
||||||
this._parentView = parentView;
|
this._parentView = parentView;
|
||||||
|
|
||||||
this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
|
this._folder = new Gio.Settings({
|
||||||
path });
|
schema_id: 'org.gnome.desktop.app-folders.folder',
|
||||||
|
path,
|
||||||
|
});
|
||||||
|
|
||||||
this.icon = new IconGrid.BaseIcon('', {
|
this.icon = new IconGrid.BaseIcon('', {
|
||||||
createIcon: this._createIcon.bind(this),
|
createIcon: this._createIcon.bind(this),
|
||||||
@ -3023,8 +3025,11 @@ var AppIcon = GObject.registerClass({
|
|||||||
this._id = app.get_id();
|
this._id = app.get_id();
|
||||||
this._name = app.get_name();
|
this._name = app.get_name();
|
||||||
|
|
||||||
this._iconContainer = new St.Widget({ layout_manager: new Clutter.BinLayout(),
|
this._iconContainer = new St.Widget({
|
||||||
x_expand: true, y_expand: true });
|
layout_manager: new Clutter.BinLayout(),
|
||||||
|
x_expand: true,
|
||||||
|
y_expand: true,
|
||||||
|
});
|
||||||
|
|
||||||
this.set_child(this._iconContainer);
|
this.set_child(this._iconContainer);
|
||||||
|
|
||||||
@ -3221,8 +3226,10 @@ var AppIcon = GObject.registerClass({
|
|||||||
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, { workspace: -1,
|
params = Params.parse(params, {
|
||||||
timestamp: 0 });
|
workspace: -1,
|
||||||
|
timestamp: 0,
|
||||||
|
});
|
||||||
|
|
||||||
this.app.open_new_window(params.workspace);
|
this.app.open_new_window(params.workspace);
|
||||||
}
|
}
|
||||||
|
@ -90,8 +90,10 @@ var AudioDeviceSelectionDialog = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_addDevice(device) {
|
_addDevice(device) {
|
||||||
let box = new St.BoxLayout({ style_class: 'audio-selection-device-box',
|
const box = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'audio-selection-device-box',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
box.connect('notify::height', () => {
|
box.connect('notify::height', () => {
|
||||||
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
||||||
box.width = box.height;
|
box.width = box.height;
|
||||||
@ -99,18 +101,24 @@ var AudioDeviceSelectionDialog = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let icon = new St.Icon({ style_class: 'audio-selection-device-icon',
|
const icon = new St.Icon({
|
||||||
icon_name: this._getDeviceIcon(device) });
|
style_class: 'audio-selection-device-icon',
|
||||||
|
icon_name: this._getDeviceIcon(device),
|
||||||
|
});
|
||||||
box.add(icon);
|
box.add(icon);
|
||||||
|
|
||||||
let label = new St.Label({ style_class: 'audio-selection-device-label',
|
const label = new St.Label({
|
||||||
|
style_class: 'audio-selection-device-label',
|
||||||
text: this._getDeviceLabel(device),
|
text: this._getDeviceLabel(device),
|
||||||
x_align: Clutter.ActorAlign.CENTER });
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
box.add(label);
|
box.add(label);
|
||||||
|
|
||||||
let button = new St.Button({ style_class: 'audio-selection-device',
|
const button = new St.Button({
|
||||||
|
style_class: 'audio-selection-device',
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
child: box });
|
child: box,
|
||||||
|
});
|
||||||
this._selectionBox.add(button);
|
this._selectionBox.add(button);
|
||||||
|
|
||||||
button.connect('clicked', () => {
|
button.connect('clicked', () => {
|
||||||
|
@ -163,9 +163,11 @@ var BackgroundCache = class BackgroundCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAnimation(params) {
|
getAnimation(params) {
|
||||||
params = Params.parse(params, { file: null,
|
params = Params.parse(params, {
|
||||||
|
file: null,
|
||||||
settingsSchema: null,
|
settingsSchema: null,
|
||||||
onLoaded: null });
|
onLoaded: null,
|
||||||
|
});
|
||||||
|
|
||||||
let animation = this._animations[params.settingsSchema];
|
let animation = this._animations[params.settingsSchema];
|
||||||
if (animation && _fileEqual0(animation.file, params.file)) {
|
if (animation && _fileEqual0(animation.file, params.file)) {
|
||||||
|
@ -67,12 +67,16 @@ var CloseDialog = GObject.registerClass({
|
|||||||
this._dialog.height = windowActor.height;
|
this._dialog.height = windowActor.height;
|
||||||
|
|
||||||
this._dialog.contentLayout.add_child(this._createDialogContent());
|
this._dialog.contentLayout.add_child(this._createDialogContent());
|
||||||
this._dialog.addButton({ label: _('Force Quit'),
|
this._dialog.addButton({
|
||||||
|
label: _('Force Quit'),
|
||||||
action: this._onClose.bind(this),
|
action: this._onClose.bind(this),
|
||||||
default: true });
|
default: true,
|
||||||
this._dialog.addButton({ label: _('Wait'),
|
});
|
||||||
|
this._dialog.addButton({
|
||||||
|
label: _('Wait'),
|
||||||
action: this._onWait.bind(this),
|
action: this._onWait.bind(this),
|
||||||
key: Clutter.KEY_Escape });
|
key: Clutter.KEY_Escape,
|
||||||
|
});
|
||||||
|
|
||||||
global.focus_manager.add_group(this._dialog);
|
global.focus_manager.add_group(this._dialog);
|
||||||
|
|
||||||
|
@ -65,9 +65,11 @@ var AutomountManager = class {
|
|||||||
_startupMountAll() {
|
_startupMountAll() {
|
||||||
let volumes = this._volumeMonitor.get_volumes();
|
let volumes = this._volumeMonitor.get_volumes();
|
||||||
volumes.forEach(volume => {
|
volumes.forEach(volume => {
|
||||||
this._checkAndMountVolume(volume, { checkSession: false,
|
this._checkAndMountVolume(volume, {
|
||||||
|
checkSession: false,
|
||||||
useMountOp: false,
|
useMountOp: false,
|
||||||
allowAutorun: false });
|
allowAutorun: false,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this._mountAllId = 0;
|
this._mountAllId = 0;
|
||||||
@ -132,9 +134,11 @@ var AutomountManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_checkAndMountVolume(volume, params) {
|
_checkAndMountVolume(volume, params) {
|
||||||
params = Params.parse(params, { checkSession: true,
|
params = Params.parse(params, {
|
||||||
|
checkSession: true,
|
||||||
useMountOp: true,
|
useMountOp: true,
|
||||||
allowAutorun: true });
|
allowAutorun: true,
|
||||||
|
});
|
||||||
|
|
||||||
if (params.checkSession) {
|
if (params.checkSession) {
|
||||||
// if we're not in the current ConsoleKit session,
|
// if we're not in the current ConsoleKit session,
|
||||||
|
@ -323,8 +323,10 @@ class AutorunNotification extends MessageTray.Notification {
|
|||||||
x_expand: true,
|
x_expand: true,
|
||||||
x_align: Clutter.ActorAlign.START,
|
x_align: Clutter.ActorAlign.START,
|
||||||
});
|
});
|
||||||
let icon = new St.Icon({ gicon: app.get_icon(),
|
const icon = new St.Icon({
|
||||||
style_class: 'hotplug-notification-item-icon' });
|
gicon: app.get_icon(),
|
||||||
|
style_class: 'hotplug-notification-item-icon',
|
||||||
|
});
|
||||||
box.add(icon);
|
box.add(icon);
|
||||||
|
|
||||||
let label = new St.Bin({
|
let label = new St.Bin({
|
||||||
@ -335,10 +337,12 @@ class AutorunNotification extends MessageTray.Notification {
|
|||||||
});
|
});
|
||||||
box.add(label);
|
box.add(label);
|
||||||
|
|
||||||
let button = new St.Button({ child: box,
|
const button = new St.Button({
|
||||||
|
child: box,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
button_mask: St.ButtonMask.ONE,
|
button_mask: St.ButtonMask.ONE,
|
||||||
style_class: 'hotplug-notification-item button' });
|
style_class: 'hotplug-notification-item button',
|
||||||
|
});
|
||||||
|
|
||||||
button.connect('clicked', () => {
|
button.connect('clicked', () => {
|
||||||
startAppForMount(app, this._mount);
|
startAppForMount(app, this._mount);
|
||||||
|
@ -598,9 +598,11 @@ var VPNRequestHandler = class {
|
|||||||
if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2)
|
if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2)
|
||||||
throw new Error('Invalid plugin keyfile version, is %d');
|
throw new Error('Invalid plugin keyfile version, is %d');
|
||||||
|
|
||||||
contentOverride = { title: keyfile.get_string(VPN_UI_GROUP, 'Title'),
|
contentOverride = {
|
||||||
|
title: keyfile.get_string(VPN_UI_GROUP, 'Title'),
|
||||||
message: keyfile.get_string(VPN_UI_GROUP, 'Description'),
|
message: keyfile.get_string(VPN_UI_GROUP, 'Description'),
|
||||||
secrets: [] };
|
secrets: [],
|
||||||
|
};
|
||||||
|
|
||||||
let [groups, len_] = keyfile.get_groups();
|
let [groups, len_] = keyfile.get_groups();
|
||||||
for (let i = 0; i < groups.length; i++) {
|
for (let i = 0; i < groups.length; i++) {
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported Component */
|
/* exported Component */
|
||||||
|
|
||||||
const { AccountsService, Clutter, GLib,
|
const {
|
||||||
GObject, Pango, PolkitAgent, Polkit, Shell, St } = imports.gi;
|
AccountsService, Clutter, GLib, GObject,
|
||||||
|
Pango, PolkitAgent, Polkit, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
|
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -135,12 +137,16 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
passwordBox.add_child(warningBox);
|
passwordBox.add_child(warningBox);
|
||||||
bodyContent.add_child(passwordBox);
|
bodyContent.add_child(passwordBox);
|
||||||
|
|
||||||
this._cancelButton = this.addButton({ label: _("Cancel"),
|
this._cancelButton = this.addButton({
|
||||||
|
label: _('Cancel'),
|
||||||
action: this.cancel.bind(this),
|
action: this.cancel.bind(this),
|
||||||
key: Clutter.KEY_Escape });
|
key: Clutter.KEY_Escape,
|
||||||
this._okButton = this.addButton({ label: _("Authenticate"),
|
});
|
||||||
|
this._okButton = this.addButton({
|
||||||
|
label: _('Authenticate'),
|
||||||
action: this._onAuthenticateButtonPressed.bind(this),
|
action: this._onAuthenticateButtonPressed.bind(this),
|
||||||
reactive: false });
|
reactive: false,
|
||||||
|
});
|
||||||
this._okButton.bind_property('reactive',
|
this._okButton.bind_property('reactive',
|
||||||
this._okButton, 'can-focus',
|
this._okButton, 'can-focus',
|
||||||
GObject.BindingFlags.SYNC_CREATE);
|
GObject.BindingFlags.SYNC_CREATE);
|
||||||
@ -168,8 +174,10 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
_initiateSession() {
|
_initiateSession() {
|
||||||
this._destroySession(DELAYED_RESET_TIMEOUT);
|
this._destroySession(DELAYED_RESET_TIMEOUT);
|
||||||
|
|
||||||
this._session = new PolkitAgent.Session({ identity: this._identityToAuth,
|
this._session = new PolkitAgent.Session({
|
||||||
cookie: this._cookie });
|
identity: this._identityToAuth,
|
||||||
|
cookie: this._cookie,
|
||||||
|
});
|
||||||
this._sessionCompletedId = this._session.connect('completed', this._onSessionCompleted.bind(this));
|
this._sessionCompletedId = this._session.connect('completed', this._onSessionCompleted.bind(this));
|
||||||
this._sessionRequestId = this._session.connect('request', this._onSessionRequest.bind(this));
|
this._sessionRequestId = this._session.connect('request', this._onSessionRequest.bind(this));
|
||||||
this._sessionShowErrorId = this._session.connect('show-error', this._onSessionShowError.bind(this));
|
this._sessionShowErrorId = this._session.connect('show-error', this._onSessionShowError.bind(this));
|
||||||
|
@ -156,9 +156,11 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
// channel matching its filters is detected.
|
// channel matching its filters is detected.
|
||||||
// The second argument, recover, means _observeChannels will be run
|
// The second argument, recover, means _observeChannels will be run
|
||||||
// for any existing channel as well.
|
// for any existing channel as well.
|
||||||
super._init({ name: 'GnomeShell',
|
super._init({
|
||||||
|
name: 'GnomeShell',
|
||||||
account_manager: this._accountManager,
|
account_manager: this._accountManager,
|
||||||
uniquify_name: true });
|
uniquify_name: true,
|
||||||
|
});
|
||||||
|
|
||||||
// We only care about single-user text-based chats
|
// We only care about single-user text-based chats
|
||||||
let filter = {};
|
let filter = {};
|
||||||
@ -255,16 +257,20 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
let chanType = channel.get_channel_type();
|
let chanType = channel.get_channel_type();
|
||||||
|
|
||||||
if (channel.get_invalidated()) {
|
if (channel.get_invalidated()) {
|
||||||
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
|
context.fail(new Tp.Error({
|
||||||
message: 'Channel is invalidated' }));
|
code: Tp.Error.INVALID_ARGUMENT,
|
||||||
|
message: 'Channel is invalidated',
|
||||||
|
}));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT) {
|
if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT) {
|
||||||
this._approveTextChannel(account, conn, channel, dispatchOp, context);
|
this._approveTextChannel(account, conn, channel, dispatchOp, context);
|
||||||
} else {
|
} else {
|
||||||
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
|
context.fail(new Tp.Error({
|
||||||
message: 'Unsupported channel type' }));
|
code: Tp.Error.INVALID_ARGUMENT,
|
||||||
|
message: 'Unsupported channel type',
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,8 +278,10 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
let [targetHandle_, targetHandleType] = channel.get_handle();
|
let [targetHandle_, targetHandleType] = channel.get_handle();
|
||||||
|
|
||||||
if (targetHandleType != Tp.HandleType.CONTACT) {
|
if (targetHandleType != Tp.HandleType.CONTACT) {
|
||||||
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
|
context.fail(new Tp.Error({
|
||||||
message: 'Unsupported handle type' }));
|
code: Tp.Error.INVALID_ARGUMENT,
|
||||||
|
message: 'Unsupported handle type',
|
||||||
|
}));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,19 +717,22 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (message.direction == NotificationDirection.RECEIVED) {
|
if (message.direction == NotificationDirection.RECEIVED) {
|
||||||
this.update(this.source.title, messageBody,
|
this.update(this.source.title, messageBody, {
|
||||||
{ datetime: GLib.DateTime.new_from_unix_local(message.timestamp),
|
datetime: GLib.DateTime.new_from_unix_local(message.timestamp),
|
||||||
bannerMarkup: true });
|
bannerMarkup: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let group = message.direction == NotificationDirection.RECEIVED
|
let group = message.direction == NotificationDirection.RECEIVED
|
||||||
? 'received' : 'sent';
|
? 'received' : 'sent';
|
||||||
|
|
||||||
this._append({ body: messageBody,
|
this._append({
|
||||||
|
body: messageBody,
|
||||||
group,
|
group,
|
||||||
styles,
|
styles,
|
||||||
timestamp: message.timestamp,
|
timestamp: message.timestamp,
|
||||||
noTimestamp });
|
noTimestamp,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_filterMessages() {
|
_filterMessages() {
|
||||||
@ -761,11 +772,13 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
|
|||||||
*/
|
*/
|
||||||
_append(props) {
|
_append(props) {
|
||||||
let currentTime = Date.now() / 1000;
|
let currentTime = Date.now() / 1000;
|
||||||
props = Params.parse(props, { body: null,
|
props = Params.parse(props, {
|
||||||
|
body: null,
|
||||||
group: null,
|
group: null,
|
||||||
styles: [],
|
styles: [],
|
||||||
timestamp: currentTime,
|
timestamp: currentTime,
|
||||||
noTimestamp: false });
|
noTimestamp: false,
|
||||||
|
});
|
||||||
const { noTimestamp } = props;
|
const { noTimestamp } = props;
|
||||||
delete props.noTimestamp;
|
delete props.noTimestamp;
|
||||||
|
|
||||||
@ -821,9 +834,11 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
|
|||||||
const message = `<i>${
|
const message = `<i>${
|
||||||
_('%s is now known as %s').format(oldAlias, newAlias)}</i>`;
|
_('%s is now known as %s').format(oldAlias, newAlias)}</i>`;
|
||||||
|
|
||||||
this._append({ body: message,
|
this._append({
|
||||||
|
body: message,
|
||||||
group: 'meta',
|
group: 'meta',
|
||||||
styles: ['chat-meta-message'] });
|
styles: ['chat-meta-message'],
|
||||||
|
});
|
||||||
|
|
||||||
this._filterMessages();
|
this._filterMessages();
|
||||||
}
|
}
|
||||||
@ -842,9 +857,11 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner {
|
|||||||
_init(notification) {
|
_init(notification) {
|
||||||
super._init(notification);
|
super._init(notification);
|
||||||
|
|
||||||
this._responseEntry = new St.Entry({ style_class: 'chat-response',
|
this._responseEntry = new St.Entry({
|
||||||
|
style_class: 'chat-response',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
can_focus: true });
|
can_focus: true,
|
||||||
|
});
|
||||||
this._responseEntry.clutter_text.connect('activate', this._onEntryActivated.bind(this));
|
this._responseEntry.clutter_text.connect('activate', this._onEntryActivated.bind(this));
|
||||||
this._responseEntry.clutter_text.connect('text-changed', this._onEntryChanged.bind(this));
|
this._responseEntry.clutter_text.connect('text-changed', this._onEntryChanged.bind(this));
|
||||||
this.setActionArea(this._responseEntry);
|
this.setActionArea(this._responseEntry);
|
||||||
@ -857,12 +874,16 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner {
|
|||||||
this.emit('unfocused');
|
this.emit('unfocused');
|
||||||
});
|
});
|
||||||
|
|
||||||
this._scrollArea = new St.ScrollView({ style_class: 'chat-scrollview vfade',
|
this._scrollArea = new St.ScrollView({
|
||||||
|
style_class: 'chat-scrollview vfade',
|
||||||
vscrollbar_policy: St.PolicyType.AUTOMATIC,
|
vscrollbar_policy: St.PolicyType.AUTOMATIC,
|
||||||
hscrollbar_policy: St.PolicyType.NEVER,
|
hscrollbar_policy: St.PolicyType.NEVER,
|
||||||
visible: this.expanded });
|
visible: this.expanded,
|
||||||
this._contentArea = new St.BoxLayout({ style_class: 'chat-body',
|
});
|
||||||
vertical: true });
|
this._contentArea = new St.BoxLayout({
|
||||||
|
style_class: 'chat-body',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
this._scrollArea.add_actor(this._contentArea);
|
this._scrollArea.add_actor(this._contentArea);
|
||||||
|
|
||||||
this.setExpandedBody(this._scrollArea);
|
this.setExpandedBody(this._scrollArea);
|
||||||
|
@ -18,15 +18,20 @@ var SortGroup = {
|
|||||||
var CtrlAltTabManager = class CtrlAltTabManager {
|
var CtrlAltTabManager = class CtrlAltTabManager {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._items = [];
|
this._items = [];
|
||||||
this.addGroup(global.window_group, _("Windows"),
|
this.addGroup(global.window_group,
|
||||||
'focus-windows-symbolic', { sortGroup: SortGroup.TOP,
|
_('Windows'),
|
||||||
focusCallback: this._focusWindows.bind(this) });
|
'focus-windows-symbolic', {
|
||||||
|
sortGroup: SortGroup.TOP,
|
||||||
|
focusCallback: this._focusWindows.bind(this),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
addGroup(root, name, icon, params) {
|
addGroup(root, name, icon, params) {
|
||||||
let item = Params.parse(params, { sortGroup: SortGroup.MIDDLE,
|
const item = Params.parse(params, {
|
||||||
|
sortGroup: SortGroup.MIDDLE,
|
||||||
proxy: root,
|
proxy: root,
|
||||||
focusCallback: null });
|
focusCallback: null,
|
||||||
|
});
|
||||||
|
|
||||||
item.root = root;
|
item.root = root;
|
||||||
item.name = name;
|
item.name = name;
|
||||||
@ -100,14 +105,16 @@ var CtrlAltTabManager = class CtrlAltTabManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
items.push({ name: windows[i].title,
|
items.push({
|
||||||
|
name: windows[i].title,
|
||||||
proxy: windows[i].get_compositor_private(),
|
proxy: windows[i].get_compositor_private(),
|
||||||
focusCallback: timestamp => {
|
focusCallback: timestamp => {
|
||||||
Main.activateWindow(windows[i], timestamp);
|
Main.activateWindow(windows[i], timestamp);
|
||||||
},
|
},
|
||||||
iconActor: icon,
|
iconActor: icon,
|
||||||
iconName,
|
iconName,
|
||||||
sortGroup: SortGroup.MIDDLE });
|
sortGroup: SortGroup.MIDDLE,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,13 +178,17 @@ class CtrlAltTabSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_addIcon(item) {
|
_addIcon(item) {
|
||||||
let box = new St.BoxLayout({ style_class: 'alt-tab-app',
|
const box = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'alt-tab-app',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
|
|
||||||
let icon = item.iconActor;
|
let icon = item.iconActor;
|
||||||
if (!icon) {
|
if (!icon) {
|
||||||
icon = new St.Icon({ icon_name: item.iconName,
|
icon = new St.Icon({
|
||||||
icon_size: POPUP_APPICON_SIZE });
|
icon_name: item.iconName,
|
||||||
|
icon_size: POPUP_APPICON_SIZE,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
box.add_child(icon);
|
box.add_child(icon);
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported Dash */
|
/* exported Dash */
|
||||||
|
|
||||||
const { Clutter, GLib, GObject,
|
const { Clutter, GLib, GObject, Graphene, Meta, Shell, St } = imports.gi;
|
||||||
Graphene, Meta, Shell, St } = imports.gi;
|
|
||||||
|
|
||||||
const AppDisplay = imports.ui.appDisplay;
|
const AppDisplay = imports.ui.appDisplay;
|
||||||
const AppFavorites = imports.ui.appFavorites;
|
const AppFavorites = imports.ui.appFavorites;
|
||||||
@ -196,15 +195,18 @@ class ShowAppsIcon extends DashItemContainer {
|
|||||||
_init() {
|
_init() {
|
||||||
super._init();
|
super._init();
|
||||||
|
|
||||||
this.toggleButton = new St.Button({ style_class: 'show-apps',
|
this.toggleButton = new St.Button({
|
||||||
|
style_class: 'show-apps',
|
||||||
track_hover: true,
|
track_hover: true,
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
toggle_mode: true });
|
toggle_mode: true,
|
||||||
|
});
|
||||||
this._iconActor = null;
|
this._iconActor = null;
|
||||||
this.icon = new IconGrid.BaseIcon(_("Show Applications"),
|
this.icon = new IconGrid.BaseIcon(_('Show Applications'), {
|
||||||
{ setSizeManually: true,
|
setSizeManually: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
createIcon: this._createIcon.bind(this) });
|
createIcon: this._createIcon.bind(this),
|
||||||
|
});
|
||||||
this.icon.y_align = Clutter.ActorAlign.CENTER;
|
this.icon.y_align = Clutter.ActorAlign.CENTER;
|
||||||
|
|
||||||
this.toggleButton.add_actor(this.icon);
|
this.toggleButton.add_actor(this.icon);
|
||||||
@ -215,10 +217,12 @@ class ShowAppsIcon extends DashItemContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_createIcon(size) {
|
_createIcon(size) {
|
||||||
this._iconActor = new St.Icon({ icon_name: 'view-app-grid-symbolic',
|
this._iconActor = new St.Icon({
|
||||||
|
icon_name: 'view-app-grid-symbolic',
|
||||||
icon_size: size,
|
icon_size: size,
|
||||||
style_class: 'show-apps-icon',
|
style_class: 'show-apps-icon',
|
||||||
track_hover: true });
|
track_hover: true,
|
||||||
|
});
|
||||||
return this._iconActor;
|
return this._iconActor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,9 +742,11 @@ var Dash = GObject.registerClass({
|
|||||||
|
|
||||||
// App added at newIndex
|
// App added at newIndex
|
||||||
if (newApp && !oldApps.includes(newApp)) {
|
if (newApp && !oldApps.includes(newApp)) {
|
||||||
addedItems.push({ app: newApp,
|
addedItems.push({
|
||||||
|
app: newApp,
|
||||||
item: this._createAppItem(newApp),
|
item: this._createAppItem(newApp),
|
||||||
pos: newIndex });
|
pos: newIndex,
|
||||||
|
});
|
||||||
newIndex++;
|
newIndex++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -756,9 +762,11 @@ var Dash = GObject.registerClass({
|
|||||||
|
|
||||||
if (insertHere || alreadyRemoved) {
|
if (insertHere || alreadyRemoved) {
|
||||||
let newItem = this._createAppItem(newApp);
|
let newItem = this._createAppItem(newApp);
|
||||||
addedItems.push({ app: newApp,
|
addedItems.push({
|
||||||
|
app: newApp,
|
||||||
item: newItem,
|
item: newItem,
|
||||||
pos: newIndex + removedActors.length });
|
pos: newIndex + removedActors.length,
|
||||||
|
});
|
||||||
newIndex++;
|
newIndex++;
|
||||||
} else {
|
} else {
|
||||||
removedActors.push(children[oldIndex]);
|
removedActors.push(children[oldIndex]);
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported DateMenuButton */
|
/* exported DateMenuButton */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GnomeDesktop,
|
const {
|
||||||
GObject, GWeather, Pango, Shell, St } = imports.gi;
|
Clutter, Gio, GLib, GnomeDesktop,
|
||||||
|
GObject, GWeather, Pango, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
|
|
||||||
const Util = imports.misc.util;
|
const Util = imports.misc.util;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -49,8 +51,10 @@ class TodayButton extends St.Button {
|
|||||||
let hbox = new St.BoxLayout({ vertical: true });
|
let hbox = new St.BoxLayout({ vertical: true });
|
||||||
this.add_actor(hbox);
|
this.add_actor(hbox);
|
||||||
|
|
||||||
this._dayLabel = new St.Label({ style_class: 'day-label',
|
this._dayLabel = new St.Label({
|
||||||
x_align: Clutter.ActorAlign.START });
|
style_class: 'day-label',
|
||||||
|
x_align: Clutter.ActorAlign.START,
|
||||||
|
});
|
||||||
hbox.add_actor(this._dayLabel);
|
hbox.add_actor(this._dayLabel);
|
||||||
|
|
||||||
this._dateLabel = new St.Label({ style_class: 'date-label' });
|
this._dateLabel = new St.Label({ style_class: 'date-label' });
|
||||||
@ -323,9 +327,11 @@ class WorldClocksSection extends St.Button {
|
|||||||
this._locations = [];
|
this._locations = [];
|
||||||
|
|
||||||
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
|
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
|
||||||
this._grid = new St.Widget({ style_class: 'world-clocks-grid',
|
this._grid = new St.Widget({
|
||||||
|
style_class: 'world-clocks-grid',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
layout_manager: layout });
|
layout_manager: layout,
|
||||||
|
});
|
||||||
layout.hookup_style(this._grid);
|
layout.hookup_style(this._grid);
|
||||||
|
|
||||||
this.child = this._grid;
|
this.child = this._grid;
|
||||||
@ -389,9 +395,11 @@ class WorldClocksSection extends St.Button {
|
|||||||
let title = this._locations.length == 0
|
let title = this._locations.length == 0
|
||||||
? _("Add world clocks…")
|
? _("Add world clocks…")
|
||||||
: _("World Clocks");
|
: _("World Clocks");
|
||||||
let header = new St.Label({ style_class: 'world-clocks-header',
|
const header = new St.Label({
|
||||||
|
style_class: 'world-clocks-header',
|
||||||
x_align: Clutter.ActorAlign.START,
|
x_align: Clutter.ActorAlign.START,
|
||||||
text: title });
|
text: title,
|
||||||
|
});
|
||||||
layout.attach(header, 0, 0, 2, 1);
|
layout.attach(header, 0, 0, 2, 1);
|
||||||
this.label_actor = header;
|
this.label_actor = header;
|
||||||
|
|
||||||
@ -399,11 +407,13 @@ class WorldClocksSection extends St.Button {
|
|||||||
let l = this._locations[i].location;
|
let l = this._locations[i].location;
|
||||||
|
|
||||||
let name = l.get_city_name() || l.get_name();
|
let name = l.get_city_name() || l.get_name();
|
||||||
let label = new St.Label({ style_class: 'world-clocks-city',
|
const label = new St.Label({
|
||||||
|
style_class: 'world-clocks-city',
|
||||||
text: name,
|
text: name,
|
||||||
x_align: Clutter.ActorAlign.START,
|
x_align: Clutter.ActorAlign.START,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
x_expand: true });
|
x_expand: true,
|
||||||
|
});
|
||||||
|
|
||||||
let time = new St.Label({ style_class: 'world-clocks-time' });
|
let time = new St.Label({ style_class: 'world-clocks-time' });
|
||||||
|
|
||||||
@ -821,7 +831,6 @@ var DateMenuButton = GObject.registerClass(
|
|||||||
class DateMenuButton extends PanelMenu.Button {
|
class DateMenuButton extends PanelMenu.Button {
|
||||||
_init() {
|
_init() {
|
||||||
let hbox;
|
let hbox;
|
||||||
let vbox;
|
|
||||||
|
|
||||||
super._init(0.5);
|
super._init(0.5);
|
||||||
|
|
||||||
@ -882,23 +891,29 @@ class DateMenuButton extends PanelMenu.Button {
|
|||||||
|
|
||||||
// Fill up the second column
|
// Fill up the second column
|
||||||
const boxLayout = new CalendarColumnLayout([this._calendar, this._date]);
|
const boxLayout = new CalendarColumnLayout([this._calendar, this._date]);
|
||||||
vbox = new St.Widget({ style_class: 'datemenu-calendar-column',
|
const vbox = new St.Widget({
|
||||||
layout_manager: boxLayout });
|
style_class: 'datemenu-calendar-column',
|
||||||
|
layout_manager: boxLayout,
|
||||||
|
});
|
||||||
boxLayout.hookup_style(vbox);
|
boxLayout.hookup_style(vbox);
|
||||||
hbox.add(vbox);
|
hbox.add(vbox);
|
||||||
|
|
||||||
vbox.add_actor(this._date);
|
vbox.add_actor(this._date);
|
||||||
vbox.add_actor(this._calendar);
|
vbox.add_actor(this._calendar);
|
||||||
|
|
||||||
this._displaysSection = new St.ScrollView({ style_class: 'datemenu-displays-section vfade',
|
this._displaysSection = new St.ScrollView({
|
||||||
|
style_class: 'datemenu-displays-section vfade',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
overlay_scrollbars: true });
|
overlay_scrollbars: true,
|
||||||
|
});
|
||||||
this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL);
|
this._displaysSection.set_policy(St.PolicyType.NEVER, St.PolicyType.EXTERNAL);
|
||||||
vbox.add_actor(this._displaysSection);
|
vbox.add_actor(this._displaysSection);
|
||||||
|
|
||||||
let displaysBox = new St.BoxLayout({ vertical: true,
|
const displaysBox = new St.BoxLayout({
|
||||||
|
vertical: true,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
style_class: 'datemenu-displays-box' });
|
style_class: 'datemenu-displays-box',
|
||||||
|
});
|
||||||
this._displaysSection.add_actor(displaysBox);
|
this._displaysSection.add_actor(displaysBox);
|
||||||
|
|
||||||
this._eventsItem = new EventsSection();
|
this._eventsItem = new EventsSection();
|
||||||
|
@ -17,8 +17,10 @@
|
|||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { AccountsService, Clutter, Gio,
|
const {
|
||||||
GLib, GObject, Pango, Polkit, Shell, St, UPowerGlib: UPower } = imports.gi;
|
AccountsService, Clutter, Gio, GLib, GObject,
|
||||||
|
Pango, Polkit, Shell, St, UPowerGlib: UPower,
|
||||||
|
} = imports.gi;
|
||||||
|
|
||||||
const CheckBox = imports.ui.checkBox;
|
const CheckBox = imports.ui.checkBox;
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
@ -226,8 +228,10 @@ function init() {
|
|||||||
var EndSessionDialog = GObject.registerClass(
|
var EndSessionDialog = GObject.registerClass(
|
||||||
class EndSessionDialog extends ModalDialog.ModalDialog {
|
class EndSessionDialog extends ModalDialog.ModalDialog {
|
||||||
_init() {
|
_init() {
|
||||||
super._init({ styleClass: 'end-session-dialog',
|
super._init({
|
||||||
destroyOnClose: false });
|
styleClass: 'end-session-dialog',
|
||||||
|
destroyOnClose: false,
|
||||||
|
});
|
||||||
|
|
||||||
this._loginManager = LoginManager.getLoginManager();
|
this._loginManager = LoginManager.getLoginManager();
|
||||||
this._loginManager.canRebootToBootLoaderMenu(
|
this._loginManager.canRebootToBootLoaderMenu(
|
||||||
@ -434,9 +438,11 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
_updateButtons() {
|
_updateButtons() {
|
||||||
this.clearButtons();
|
this.clearButtons();
|
||||||
|
|
||||||
this.addButton({ action: this.cancel.bind(this),
|
this.addButton({
|
||||||
label: _("Cancel"),
|
action: this.cancel.bind(this),
|
||||||
key: Clutter.KEY_Escape });
|
label: _('Cancel'),
|
||||||
|
key: Clutter.KEY_Escape,
|
||||||
|
});
|
||||||
|
|
||||||
let dialogContent = DialogContent[this._type];
|
let dialogContent = DialogContent[this._type];
|
||||||
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
|
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
|
||||||
@ -669,10 +675,12 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
if (proxy.Id == sessionId)
|
if (proxy.Id == sessionId)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
let session = { user: this._userManager.get_user(userName),
|
const session = {
|
||||||
|
user: this._userManager.get_user(userName),
|
||||||
username: userName,
|
username: userName,
|
||||||
type: proxy.Type,
|
type: proxy.Type,
|
||||||
remote: proxy.Remote };
|
remote: proxy.Remote,
|
||||||
|
};
|
||||||
this._sessions.push(session);
|
this._sessions.push(session);
|
||||||
|
|
||||||
let userAvatar = new UserWidget.Avatar(session.user, { iconSize: _ITEM_ICON_SIZE });
|
let userAvatar = new UserWidget.Avatar(session.user, { iconSize: _ITEM_ICON_SIZE });
|
||||||
|
@ -327,8 +327,10 @@ function init() {
|
|||||||
// Miscellaneous monkeypatching
|
// Miscellaneous monkeypatching
|
||||||
_patchContainerClass(St.BoxLayout);
|
_patchContainerClass(St.BoxLayout);
|
||||||
|
|
||||||
_patchLayoutClass(Clutter.GridLayout, { row_spacing: 'spacing-rows',
|
_patchLayoutClass(Clutter.GridLayout, {
|
||||||
column_spacing: 'spacing-columns' });
|
row_spacing: 'spacing-rows',
|
||||||
|
column_spacing: 'spacing-columns',
|
||||||
|
});
|
||||||
_patchLayoutClass(Clutter.BoxLayout, { spacing: 'spacing' });
|
_patchLayoutClass(Clutter.BoxLayout, { spacing: 'spacing' });
|
||||||
|
|
||||||
let origSetEasingDuration = Clutter.Actor.prototype.set_easing_duration;
|
let origSetEasingDuration = Clutter.Actor.prototype.set_easing_duration;
|
||||||
|
@ -111,9 +111,11 @@ var GrabHelper = class GrabHelper {
|
|||||||
// use cases like menus, where we want to grab the menu actor, but keep
|
// use cases like menus, where we want to grab the menu actor, but keep
|
||||||
// focus on the clicked on menu item.
|
// focus on the clicked on menu item.
|
||||||
grab(params) {
|
grab(params) {
|
||||||
params = Params.parse(params, { actor: null,
|
params = Params.parse(params, {
|
||||||
|
actor: null,
|
||||||
focus: null,
|
focus: null,
|
||||||
onUngrab: null });
|
onUngrab: null,
|
||||||
|
});
|
||||||
|
|
||||||
let focus = global.stage.key_focus;
|
let focus = global.stage.key_focus;
|
||||||
let hadFocus = focus && this._isWithinGrabbedActor(focus);
|
let hadFocus = focus && this._isWithinGrabbedActor(focus);
|
||||||
@ -202,8 +204,10 @@ var GrabHelper = class GrabHelper {
|
|||||||
// The onUngrab callback for every grab is called for every popped
|
// The onUngrab callback for every grab is called for every popped
|
||||||
// grab with the parameter %false.
|
// grab with the parameter %false.
|
||||||
ungrab(params) {
|
ungrab(params) {
|
||||||
params = Params.parse(params, { actor: this.currentGrab.actor,
|
params = Params.parse(params, {
|
||||||
isUser: false });
|
actor: this.currentGrab.actor,
|
||||||
|
isUser: false,
|
||||||
|
});
|
||||||
|
|
||||||
let grabStackIndex = this._findStackIndex(params.actor);
|
let grabStackIndex = this._findStackIndex(params.actor);
|
||||||
if (grabStackIndex < 0)
|
if (grabStackIndex < 0)
|
||||||
|
@ -34,9 +34,11 @@ var CandidateArea = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
this._candidateBoxes = [];
|
this._candidateBoxes = [];
|
||||||
for (let i = 0; i < MAX_CANDIDATES_PER_PAGE; ++i) {
|
for (let i = 0; i < MAX_CANDIDATES_PER_PAGE; ++i) {
|
||||||
let box = new St.BoxLayout({ style_class: 'candidate-box',
|
const box = new St.BoxLayout({
|
||||||
|
style_class: 'candidate-box',
|
||||||
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);
|
||||||
@ -155,16 +157,22 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
|
|||||||
|
|
||||||
Main.layoutManager.addChrome(this);
|
Main.layoutManager.addChrome(this);
|
||||||
|
|
||||||
let box = new St.BoxLayout({ style_class: 'candidate-popup-content',
|
const box = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'candidate-popup-content',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
this.bin.set_child(box);
|
this.bin.set_child(box);
|
||||||
|
|
||||||
this._preeditText = new St.Label({ style_class: 'candidate-popup-text',
|
this._preeditText = new St.Label({
|
||||||
visible: false });
|
style_class: 'candidate-popup-text',
|
||||||
|
visible: false,
|
||||||
|
});
|
||||||
box.add(this._preeditText);
|
box.add(this._preeditText);
|
||||||
|
|
||||||
this._auxText = new St.Label({ style_class: 'candidate-popup-text',
|
this._auxText = new St.Label({
|
||||||
visible: false });
|
style_class: 'candidate-popup-text',
|
||||||
|
visible: false,
|
||||||
|
});
|
||||||
box.add(this._auxText);
|
box.add(this._auxText);
|
||||||
|
|
||||||
this._candidateArea = new CandidateArea();
|
this._candidateArea = new CandidateArea();
|
||||||
|
@ -97,19 +97,23 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
|||||||
|
|
||||||
this._dialog.contentLayout.add_child(content);
|
this._dialog.contentLayout.add_child(content);
|
||||||
|
|
||||||
this._dialog.addButton({ label: _("Deny"),
|
this._dialog.addButton({
|
||||||
|
label: _('Deny'),
|
||||||
action: () => {
|
action: () => {
|
||||||
this._saveToPermissionStore(DENIED);
|
this._saveToPermissionStore(DENIED);
|
||||||
this._emitResponse(DialogResponse.DENY);
|
this._emitResponse(DialogResponse.DENY);
|
||||||
},
|
},
|
||||||
key: Clutter.KEY_Escape });
|
key: Clutter.KEY_Escape,
|
||||||
|
});
|
||||||
|
|
||||||
this._dialog.addButton({ label: _("Allow"),
|
this._dialog.addButton({
|
||||||
|
label: _('Allow'),
|
||||||
action: () => {
|
action: () => {
|
||||||
this._saveToPermissionStore(GRANTED);
|
this._saveToPermissionStore(GRANTED);
|
||||||
this._emitResponse(DialogResponse.ALLOW);
|
this._emitResponse(DialogResponse.ALLOW);
|
||||||
},
|
},
|
||||||
default: true });
|
default: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_emitResponse(response) {
|
_emitResponse(response) {
|
||||||
|
@ -51,21 +51,25 @@ class KbdA11yDialog extends GObject.Object {
|
|||||||
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({ label: enabled ? _("Leave On") : _("Turn On"),
|
dialog.addButton({
|
||||||
|
label: enabled ? _('Leave On') : _('Turn On'),
|
||||||
action: () => {
|
action: () => {
|
||||||
this._a11ySettings.set_boolean(key, true);
|
this._a11ySettings.set_boolean(key, true);
|
||||||
dialog.close();
|
dialog.close();
|
||||||
},
|
},
|
||||||
default: enabled,
|
default: enabled,
|
||||||
key: !enabled ? Clutter.KEY_Escape : null });
|
key: !enabled ? Clutter.KEY_Escape : null,
|
||||||
|
});
|
||||||
|
|
||||||
dialog.addButton({ label: enabled ? _("Turn Off") : _("Leave Off"),
|
dialog.addButton({
|
||||||
|
label: enabled ? _('Turn Off') : _('Leave Off'),
|
||||||
action: () => {
|
action: () => {
|
||||||
this._a11ySettings.set_boolean(key, false);
|
this._a11ySettings.set_boolean(key, false);
|
||||||
dialog.close();
|
dialog.close();
|
||||||
},
|
},
|
||||||
default: !enabled,
|
default: !enabled,
|
||||||
key: enabled ? Clutter.KEY_Escape : null });
|
key: enabled ? Clutter.KEY_Escape : null,
|
||||||
|
});
|
||||||
|
|
||||||
dialog.open();
|
dialog.open();
|
||||||
}
|
}
|
||||||
|
@ -127,9 +127,11 @@ class AspectContainer extends St.Widget {
|
|||||||
var KeyContainer = GObject.registerClass(
|
var KeyContainer = GObject.registerClass(
|
||||||
class KeyContainer extends St.Widget {
|
class KeyContainer extends St.Widget {
|
||||||
_init() {
|
_init() {
|
||||||
let gridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.HORIZONTAL,
|
const gridLayout = new Clutter.GridLayout({
|
||||||
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
column_homogeneous: true,
|
column_homogeneous: true,
|
||||||
row_homogeneous: true });
|
row_homogeneous: true,
|
||||||
|
});
|
||||||
super._init({
|
super._init({
|
||||||
layout_manager: gridLayout,
|
layout_manager: gridLayout,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
@ -880,13 +882,17 @@ var EmojiPager = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_generatePanel(nPage) {
|
_generatePanel(nPage) {
|
||||||
let gridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.HORIZONTAL,
|
const gridLayout = new Clutter.GridLayout({
|
||||||
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
column_homogeneous: true,
|
column_homogeneous: true,
|
||||||
row_homogeneous: true });
|
row_homogeneous: true,
|
||||||
let panel = new St.Widget({ layout_manager: gridLayout,
|
});
|
||||||
|
const panel = new St.Widget({
|
||||||
|
layout_manager: gridLayout,
|
||||||
style_class: 'emoji-page',
|
style_class: 'emoji-page',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true });
|
y_expand: true,
|
||||||
|
});
|
||||||
|
|
||||||
/* Set an expander actor so all proportions are right despite the panel
|
/* Set an expander actor so all proportions are right despite the panel
|
||||||
* not having all rows/cols filled in.
|
* not having all rows/cols filled in.
|
||||||
@ -1119,8 +1125,11 @@ var EmojiSelection = GObject.registerClass({
|
|||||||
row.appendKey(key);
|
row.appendKey(key);
|
||||||
row.layoutButtons();
|
row.layoutButtons();
|
||||||
|
|
||||||
let actor = new AspectContainer({ layout_manager: new Clutter.BinLayout(),
|
const actor = new AspectContainer({
|
||||||
x_expand: true, y_expand: true });
|
layout_manager: new Clutter.BinLayout(),
|
||||||
|
x_expand: true,
|
||||||
|
y_expand: true,
|
||||||
|
});
|
||||||
actor.add_child(row);
|
actor.add_child(row);
|
||||||
/* Regular keyboard layouts are 11.5×4 grids, optimize for that
|
/* Regular keyboard layouts are 11.5×4 grids, optimize for that
|
||||||
* at the moment. Ideally this should be as wide as the current
|
* at the moment. Ideally this should be as wide as the current
|
||||||
@ -1159,9 +1168,11 @@ var Keypad = GObject.registerClass({
|
|||||||
y_expand: true,
|
y_expand: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
let gridLayout = new Clutter.GridLayout({ orientation: Clutter.Orientation.HORIZONTAL,
|
const gridLayout = new Clutter.GridLayout({
|
||||||
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
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);
|
||||||
|
|
||||||
|
@ -229,9 +229,11 @@ var LayoutManager = GObject.registerClass({
|
|||||||
global.stage.remove_actor(global.top_window_group);
|
global.stage.remove_actor(global.top_window_group);
|
||||||
this.uiGroup.add_actor(global.top_window_group);
|
this.uiGroup.add_actor(global.top_window_group);
|
||||||
|
|
||||||
this.overviewGroup = new St.Widget({ name: 'overviewGroup',
|
this.overviewGroup = new St.Widget({
|
||||||
|
name: 'overviewGroup',
|
||||||
visible: false,
|
visible: false,
|
||||||
reactive: true });
|
reactive: true,
|
||||||
|
});
|
||||||
this.addChrome(this.overviewGroup);
|
this.addChrome(this.overviewGroup);
|
||||||
|
|
||||||
this.screenShieldGroup = new St.Widget({
|
this.screenShieldGroup = new St.Widget({
|
||||||
@ -242,20 +244,28 @@ var LayoutManager = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
this.addChrome(this.screenShieldGroup);
|
this.addChrome(this.screenShieldGroup);
|
||||||
|
|
||||||
this.panelBox = new St.BoxLayout({ name: 'panelBox',
|
this.panelBox = new St.BoxLayout({
|
||||||
vertical: true });
|
name: 'panelBox',
|
||||||
this.addChrome(this.panelBox, { affectsStruts: true,
|
vertical: true,
|
||||||
trackFullscreen: true });
|
});
|
||||||
|
this.addChrome(this.panelBox, {
|
||||||
|
affectsStruts: true,
|
||||||
|
trackFullscreen: true,
|
||||||
|
});
|
||||||
this.panelBox.connect('notify::allocation',
|
this.panelBox.connect('notify::allocation',
|
||||||
this._panelBoxChanged.bind(this));
|
this._panelBoxChanged.bind(this));
|
||||||
|
|
||||||
this.modalDialogGroup = new St.Widget({ name: 'modalDialogGroup',
|
this.modalDialogGroup = new St.Widget({
|
||||||
layout_manager: new Clutter.BinLayout() });
|
name: 'modalDialogGroup',
|
||||||
|
layout_manager: new Clutter.BinLayout(),
|
||||||
|
});
|
||||||
this.uiGroup.add_actor(this.modalDialogGroup);
|
this.uiGroup.add_actor(this.modalDialogGroup);
|
||||||
|
|
||||||
this.keyboardBox = new St.BoxLayout({ name: 'keyboardBox',
|
this.keyboardBox = new St.BoxLayout({
|
||||||
|
name: 'keyboardBox',
|
||||||
reactive: true,
|
reactive: true,
|
||||||
track_hover: true });
|
track_hover: true,
|
||||||
|
});
|
||||||
this.addTopChrome(this.keyboardBox);
|
this.addTopChrome(this.keyboardBox);
|
||||||
this._keyboardHeightNotifyId = 0;
|
this._keyboardHeightNotifyId = 0;
|
||||||
|
|
||||||
@ -448,9 +458,11 @@ var LayoutManager = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
_createBackgroundManager(monitorIndex) {
|
_createBackgroundManager(monitorIndex) {
|
||||||
let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
|
const bgManager = new Background.BackgroundManager({
|
||||||
|
container: this._backgroundGroup,
|
||||||
layoutManager: this,
|
layoutManager: this,
|
||||||
monitorIndex });
|
monitorIndex,
|
||||||
|
});
|
||||||
|
|
||||||
bgManager.connect('changed', this._addBackgroundMenu.bind(this));
|
bgManager.connect('changed', this._addBackgroundMenu.bind(this));
|
||||||
this._addBackgroundMenu(bgManager);
|
this._addBackgroundMenu(bgManager);
|
||||||
@ -543,10 +555,12 @@ var LayoutManager = GObject.registerClass({
|
|||||||
if (this.panelBox.height) {
|
if (this.panelBox.height) {
|
||||||
let primary = this.primaryMonitor;
|
let primary = this.primaryMonitor;
|
||||||
|
|
||||||
this._rightPanelBarrier = new Meta.Barrier({ display: global.display,
|
this._rightPanelBarrier = new Meta.Barrier({
|
||||||
|
display: global.display,
|
||||||
x1: primary.x + primary.width, y1: primary.y,
|
x1: primary.x + primary.width, y1: primary.y,
|
||||||
x2: primary.x + primary.width, y2: primary.y + this.panelBox.height,
|
x2: primary.x + primary.width, y2: primary.y + this.panelBox.height,
|
||||||
directions: Meta.BarrierDirection.NEGATIVE_X });
|
directions: Meta.BarrierDirection.NEGATIVE_X,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -620,8 +634,10 @@ var LayoutManager = GObject.registerClass({
|
|||||||
|
|
||||||
global.stage.insert_child_below(this._systemBackground, null);
|
global.stage.insert_child_below(this._systemBackground, null);
|
||||||
|
|
||||||
let constraint = new Clutter.BindConstraint({ source: global.stage,
|
const constraint = new Clutter.BindConstraint({
|
||||||
coordinate: Clutter.BindCoordinate.ALL });
|
source: global.stage,
|
||||||
|
coordinate: Clutter.BindCoordinate.ALL,
|
||||||
|
});
|
||||||
this._systemBackground.add_constraint(constraint);
|
this._systemBackground.add_constraint(constraint);
|
||||||
|
|
||||||
let signalId = this._systemBackground.connect('loaded', () => {
|
let signalId = this._systemBackground.connect('loaded', () => {
|
||||||
@ -661,10 +677,12 @@ var LayoutManager = GObject.registerClass({
|
|||||||
async _prepareStartupAnimation() {
|
async _prepareStartupAnimation() {
|
||||||
// During the initial transition, add a simple actor to block all events,
|
// During the initial transition, add a simple actor to block all events,
|
||||||
// so they don't get delivered to X11 windows that have been transformed.
|
// so they don't get delivered to X11 windows that have been transformed.
|
||||||
this._coverPane = new Clutter.Actor({ opacity: 0,
|
this._coverPane = new Clutter.Actor({
|
||||||
|
opacity: 0,
|
||||||
width: global.screen_width,
|
width: global.screen_width,
|
||||||
height: global.screen_height,
|
height: global.screen_height,
|
||||||
reactive: true });
|
reactive: true,
|
||||||
|
});
|
||||||
this.addChrome(this._coverPane);
|
this.addChrome(this._coverPane);
|
||||||
|
|
||||||
if (Meta.is_restart()) {
|
if (Meta.is_restart()) {
|
||||||
@ -1133,19 +1151,27 @@ class HotCorner extends Clutter.Actor {
|
|||||||
|
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
|
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
|
||||||
this._verticalBarrier = new Meta.Barrier({ display: global.display,
|
this._verticalBarrier = new Meta.Barrier({
|
||||||
|
display: global.display,
|
||||||
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
|
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
|
||||||
directions: Meta.BarrierDirection.NEGATIVE_X });
|
directions: Meta.BarrierDirection.NEGATIVE_X,
|
||||||
this._horizontalBarrier = new Meta.Barrier({ display: global.display,
|
});
|
||||||
|
this._horizontalBarrier = new Meta.Barrier({
|
||||||
|
display: global.display,
|
||||||
x1: this._x - size, x2: this._x, y1: this._y, y2: this._y,
|
x1: this._x - size, x2: this._x, y1: this._y, y2: this._y,
|
||||||
directions: Meta.BarrierDirection.POSITIVE_Y });
|
directions: Meta.BarrierDirection.POSITIVE_Y,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._verticalBarrier = new Meta.Barrier({ display: global.display,
|
this._verticalBarrier = new Meta.Barrier({
|
||||||
|
display: global.display,
|
||||||
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
|
x1: this._x, x2: this._x, y1: this._y, y2: this._y + size,
|
||||||
directions: Meta.BarrierDirection.POSITIVE_X });
|
directions: Meta.BarrierDirection.POSITIVE_X,
|
||||||
this._horizontalBarrier = new Meta.Barrier({ display: global.display,
|
});
|
||||||
|
this._horizontalBarrier = new Meta.Barrier({
|
||||||
|
display: global.display,
|
||||||
x1: this._x, x2: this._x + size, y1: this._y, y2: this._y,
|
x1: this._x, x2: this._x + size, y1: this._y, y2: this._y,
|
||||||
directions: Meta.BarrierDirection.POSITIVE_Y });
|
directions: Meta.BarrierDirection.POSITIVE_Y,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this._pressureBarrier.addBarrier(this._verticalBarrier);
|
this._pressureBarrier.addBarrier(this._verticalBarrier);
|
||||||
@ -1164,11 +1190,13 @@ class HotCorner extends Clutter.Actor {
|
|||||||
reactive: true,
|
reactive: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._corner = new Clutter.Actor({ name: 'hot-corner',
|
this._corner = new Clutter.Actor({
|
||||||
|
name: 'hot-corner',
|
||||||
width: 1,
|
width: 1,
|
||||||
height: 1,
|
height: 1,
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
reactive: true });
|
reactive: true,
|
||||||
|
});
|
||||||
this._corner._delegate = this;
|
this._corner._delegate = this;
|
||||||
|
|
||||||
this.add_child(this._corner);
|
this.add_child(this._corner);
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported LookingGlass */
|
/* exported LookingGlass */
|
||||||
|
|
||||||
const { Clutter, Cogl, Gio, GLib, GObject,
|
const {
|
||||||
Graphene, Meta, Pango, Shell, St } = imports.gi;
|
Clutter, Cogl, Gio, GLib, GObject, Graphene, Meta, Pango, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
const System = imports.system;
|
const System = imports.system;
|
||||||
|
|
||||||
@ -94,13 +95,17 @@ var AutoComplete = class AutoComplete {
|
|||||||
let [completions, attrHead] = JsParse.getCompletions(text, commandHeader, AUTO_COMPLETE_GLOBAL_KEYWORDS);
|
let [completions, attrHead] = JsParse.getCompletions(text, commandHeader, AUTO_COMPLETE_GLOBAL_KEYWORDS);
|
||||||
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,
|
||||||
attrHead });
|
attrHead,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._processCompletionRequest({ tabType: 'single',
|
this._processCompletionRequest({
|
||||||
|
tabType: 'single',
|
||||||
completions,
|
completions,
|
||||||
attrHead });
|
attrHead,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this._lastTabTime = currTime;
|
this._lastTabTime = currTime;
|
||||||
}
|
}
|
||||||
@ -135,9 +140,11 @@ var Notebook = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
appendPage(name, child) {
|
appendPage(name, child) {
|
||||||
let labelBox = new St.BoxLayout({ style_class: 'notebook-tab',
|
const labelBox = new St.BoxLayout({
|
||||||
|
style_class: 'notebook-tab',
|
||||||
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);
|
||||||
@ -150,11 +157,13 @@ 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,
|
const tabData = {
|
||||||
|
child,
|
||||||
labelBox,
|
labelBox,
|
||||||
label,
|
label,
|
||||||
scrollView: scrollview,
|
scrollView: scrollview,
|
||||||
_scrollToBottom: false };
|
_scrollToBottom: false,
|
||||||
|
};
|
||||||
this._tabs.push(tabData);
|
this._tabs.push(tabData);
|
||||||
scrollview.hide();
|
scrollview.hide();
|
||||||
this.add_child(scrollview);
|
this.add_child(scrollview);
|
||||||
@ -531,17 +540,21 @@ class RedBorderEffect extends Clutter.Effect {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var Inspector = GObject.registerClass({
|
var Inspector = GObject.registerClass({
|
||||||
Signals: { 'closed': {},
|
Signals: {
|
||||||
'target': { param_types: [Clutter.Actor.$gtype, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] } },
|
'closed': {},
|
||||||
|
'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);
|
||||||
|
|
||||||
let eventHandler = new St.BoxLayout({ name: 'LookingGlassDialog',
|
const eventHandler = new St.BoxLayout({
|
||||||
|
name: 'LookingGlassDialog',
|
||||||
vertical: false,
|
vertical: false,
|
||||||
reactive: true });
|
reactive: true,
|
||||||
|
});
|
||||||
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 });
|
||||||
@ -673,11 +686,15 @@ var Extensions = GObject.registerClass({
|
|||||||
super._init({ vertical: true, name: 'lookingGlassExtensions' });
|
super._init({ vertical: true, name: 'lookingGlassExtensions' });
|
||||||
|
|
||||||
this._lookingGlass = lookingGlass;
|
this._lookingGlass = lookingGlass;
|
||||||
this._noExtensions = new St.Label({ style_class: 'lg-extensions-none',
|
this._noExtensions = new St.Label({
|
||||||
text: _("No extensions installed") });
|
style_class: 'lg-extensions-none',
|
||||||
|
text: _('No extensions installed'),
|
||||||
|
});
|
||||||
this._numExtensions = 0;
|
this._numExtensions = 0;
|
||||||
this._extensionsList = new St.BoxLayout({ vertical: true,
|
this._extensionsList = new St.BoxLayout({
|
||||||
style_class: 'lg-extensions-list' });
|
vertical: true,
|
||||||
|
style_class: 'lg-extensions-list',
|
||||||
|
});
|
||||||
this._extensionsList.add(this._noExtensions);
|
this._extensionsList.add(this._noExtensions);
|
||||||
this.add(this._extensionsList);
|
this.add(this._extensionsList);
|
||||||
|
|
||||||
@ -783,32 +800,40 @@ var Extensions = GObject.registerClass({
|
|||||||
|
|
||||||
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);
|
||||||
let state = new St.Label({ style_class: 'lg-extension-state',
|
const state = new St.Label({
|
||||||
text: this._stateToString(extension.state) });
|
style_class: 'lg-extension-state',
|
||||||
|
text: this._stateToString(extension.state),
|
||||||
|
});
|
||||||
metaBox.add(state);
|
metaBox.add(state);
|
||||||
|
|
||||||
let viewsource = new St.Button({ reactive: true,
|
const viewsource = new St.Button({
|
||||||
|
reactive: true,
|
||||||
track_hover: true,
|
track_hover: true,
|
||||||
style_class: 'shell-link',
|
style_class: 'shell-link',
|
||||||
label: _("View Source") });
|
label: _('View Source'),
|
||||||
|
});
|
||||||
viewsource._extension = extension;
|
viewsource._extension = extension;
|
||||||
viewsource.connect('clicked', this._onViewSource.bind(this));
|
viewsource.connect('clicked', this._onViewSource.bind(this));
|
||||||
metaBox.add(viewsource);
|
metaBox.add(viewsource);
|
||||||
|
|
||||||
if (extension.metadata.url) {
|
if (extension.metadata.url) {
|
||||||
let webpage = new St.Button({ reactive: true,
|
const webpage = new St.Button({
|
||||||
|
reactive: true,
|
||||||
track_hover: true,
|
track_hover: true,
|
||||||
style_class: 'shell-link',
|
style_class: 'shell-link',
|
||||||
label: _("Web Page") });
|
label: _('Web Page'),
|
||||||
|
});
|
||||||
webpage._extension = extension;
|
webpage._extension = extension;
|
||||||
webpage.connect('clicked', this._onWebPage.bind(this));
|
webpage.connect('clicked', this._onWebPage.bind(this));
|
||||||
metaBox.add(webpage);
|
metaBox.add(webpage);
|
||||||
}
|
}
|
||||||
|
|
||||||
let viewerrors = new St.Button({ reactive: true,
|
const viewerrors = new St.Button({
|
||||||
|
reactive: true,
|
||||||
track_hover: true,
|
track_hover: true,
|
||||||
style_class: 'shell-link',
|
style_class: 'shell-link',
|
||||||
label: _("Show Errors") });
|
label: _('Show Errors'),
|
||||||
|
});
|
||||||
viewerrors._extension = extension;
|
viewerrors._extension = extension;
|
||||||
viewerrors._parentBox = box;
|
viewerrors._parentBox = box;
|
||||||
viewerrors._isShowing = false;
|
viewerrors._isShowing = false;
|
||||||
@ -1358,8 +1383,10 @@ class LookingGlass extends St.BoxLayout {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY,
|
this._history = new History.HistoryManager({
|
||||||
entry: this._entry.clutter_text });
|
gsettingsKey: HISTORY_KEY,
|
||||||
|
entry: this._entry.clutter_text,
|
||||||
|
});
|
||||||
|
|
||||||
this._autoComplete = new AutoComplete(this._entry);
|
this._autoComplete = new AutoComplete(this._entry);
|
||||||
this._autoComplete.connect('suggest', (a, e) => {
|
this._autoComplete.connect('suggest', (a, e) => {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const { Atspi, Clutter, GDesktopEnums,
|
const {
|
||||||
Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
Atspi, Clutter, GDesktopEnums, Gio, GLib, GObject, Meta, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Background = imports.ui.background;
|
const Background = imports.ui.background;
|
||||||
@ -884,10 +885,12 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
* magnification factor to of the magnified view.
|
* magnification factor to of the magnified view.
|
||||||
*/
|
*/
|
||||||
setMagFactor(xMagFactor, yMagFactor) {
|
setMagFactor(xMagFactor, yMagFactor) {
|
||||||
this._changeROI({ xMagFactor,
|
this._changeROI({
|
||||||
|
xMagFactor,
|
||||||
yMagFactor,
|
yMagFactor,
|
||||||
redoCursorTracking: this._followingCursor,
|
redoCursorTracking: this._followingCursor,
|
||||||
animate: true });
|
animate: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -981,10 +984,12 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this._followingCursor = false;
|
this._followingCursor = false;
|
||||||
this._changeROI({ xMagFactor: this._viewPortWidth / roi.width,
|
this._changeROI({
|
||||||
|
xMagFactor: this._viewPortWidth / roi.width,
|
||||||
yMagFactor: this._viewPortHeight / roi.height,
|
yMagFactor: this._viewPortHeight / roi.height,
|
||||||
xCenter: roi.x + roi.width / 2,
|
xCenter: roi.x + roi.width / 2,
|
||||||
yCenter: roi.y + roi.height / 2 });
|
yCenter: roi.y + roi.height / 2,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1209,9 +1214,11 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
this._clearScrollContentsTimer();
|
this._clearScrollContentsTimer();
|
||||||
|
|
||||||
this._followingCursor = false;
|
this._followingCursor = false;
|
||||||
this._changeROI({ xCenter: x,
|
this._changeROI({
|
||||||
|
xCenter: x,
|
||||||
yCenter: y,
|
yCenter: y,
|
||||||
animate: true });
|
animate: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1345,8 +1352,10 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
|
|
||||||
// Clone the group that contains all of UI on the screen. This is the
|
// Clone the group that contains all of UI on the screen. This is the
|
||||||
// chrome, the windows, etc.
|
// chrome, the windows, etc.
|
||||||
this._uiGroupClone = new Clutter.Clone({ source: Main.uiGroup,
|
this._uiGroupClone = new Clutter.Clone({
|
||||||
clip_to_allocation: true });
|
source: Main.uiGroup,
|
||||||
|
clip_to_allocation: true,
|
||||||
|
});
|
||||||
mainGroup.add_actor(this._uiGroupClone);
|
mainGroup.add_actor(this._uiGroupClone);
|
||||||
|
|
||||||
// Add either the given mouseSourceActor to the ZoomRegion, or a clone of
|
// Add either the given mouseSourceActor to the ZoomRegion, or a clone of
|
||||||
@ -1419,12 +1428,14 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
// and center can be set explicitly, or we can recompute
|
// and center can be set explicitly, or we can recompute
|
||||||
// the position based on the mouse cursor position
|
// the position based on the mouse cursor position
|
||||||
|
|
||||||
params = Params.parse(params, { xMagFactor: this._xMagFactor,
|
params = Params.parse(params, {
|
||||||
|
xMagFactor: this._xMagFactor,
|
||||||
yMagFactor: this._yMagFactor,
|
yMagFactor: this._yMagFactor,
|
||||||
xCenter: this._xCenter,
|
xCenter: this._xCenter,
|
||||||
yCenter: this._yCenter,
|
yCenter: this._yCenter,
|
||||||
redoCursorTracking: false,
|
redoCursorTracking: false,
|
||||||
animate: false });
|
animate: false,
|
||||||
|
});
|
||||||
|
|
||||||
if (params.xMagFactor <= 0)
|
if (params.xMagFactor <= 0)
|
||||||
params.xMagFactor = this._xMagFactor;
|
params.xMagFactor = this._xMagFactor;
|
||||||
@ -1457,10 +1468,12 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
// over the actual mouse. However, in full screen mode, the "lens" is
|
// over the actual mouse. However, in full screen mode, the "lens" is
|
||||||
// the size of the screen -- pointless to move such a large lens around.
|
// the size of the screen -- pointless to move such a large lens around.
|
||||||
if (this._lensMode && !this._isFullScreen()) {
|
if (this._lensMode && !this._isFullScreen()) {
|
||||||
this._setViewPort({ x: this._xCenter - this._viewPortWidth / 2,
|
this._setViewPort({
|
||||||
|
x: this._xCenter - this._viewPortWidth / 2,
|
||||||
y: this._yCenter - this._viewPortHeight / 2,
|
y: this._yCenter - this._viewPortHeight / 2,
|
||||||
width: this._viewPortWidth,
|
width: this._viewPortWidth,
|
||||||
height: this._viewPortHeight }, true);
|
height: this._viewPortHeight,
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._updateCloneGeometry(params.animate);
|
this._updateCloneGeometry(params.animate);
|
||||||
|
@ -555,9 +555,11 @@ function _findModal(grab) {
|
|||||||
* @returns {Clutter.Grab}: the grab handle created
|
* @returns {Clutter.Grab}: the grab handle created
|
||||||
*/
|
*/
|
||||||
function pushModal(actor, params) {
|
function pushModal(actor, params) {
|
||||||
params = Params.parse(params, { timestamp: global.get_current_time(),
|
params = Params.parse(params, {
|
||||||
|
timestamp: global.get_current_time(),
|
||||||
options: 0,
|
options: 0,
|
||||||
actionMode: Shell.ActionMode.NONE });
|
actionMode: Shell.ActionMode.NONE,
|
||||||
|
});
|
||||||
|
|
||||||
let grab = global.stage.grab(actor);
|
let grab = global.stage.grab(actor);
|
||||||
|
|
||||||
@ -582,7 +584,8 @@ function pushModal(actor, params) {
|
|||||||
modalActorFocusStack[index].prevFocus = null;
|
modalActorFocusStack[index].prevFocus = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
modalActorFocusStack.push({ actor,
|
modalActorFocusStack.push({
|
||||||
|
actor,
|
||||||
grab,
|
grab,
|
||||||
destroyId: actorDestroyId,
|
destroyId: actorDestroyId,
|
||||||
prevFocus,
|
prevFocus,
|
||||||
@ -788,8 +791,10 @@ 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,
|
_deferredWorkData[workId] = {
|
||||||
callback };
|
actor,
|
||||||
|
callback,
|
||||||
|
};
|
||||||
actor.connect('notify::mapped', () => {
|
actor.connect('notify::mapped', () => {
|
||||||
if (!(actor.mapped && _deferredWorkQueue.includes(workId)))
|
if (!(actor.mapped && _deferredWorkQueue.includes(workId)))
|
||||||
return;
|
return;
|
||||||
@ -838,10 +843,12 @@ function queueDeferredWork(workId) {
|
|||||||
var RestartMessage = GObject.registerClass(
|
var RestartMessage = GObject.registerClass(
|
||||||
class RestartMessage extends ModalDialog.ModalDialog {
|
class RestartMessage extends ModalDialog.ModalDialog {
|
||||||
_init(message) {
|
_init(message) {
|
||||||
super._init({ shellReactive: true,
|
super._init({
|
||||||
|
shellReactive: true,
|
||||||
styleClass: 'restart-message headline',
|
styleClass: 'restart-message headline',
|
||||||
shouldFadeIn: false,
|
shouldFadeIn: false,
|
||||||
destroyOnClose: true });
|
destroyOnClose: true,
|
||||||
|
});
|
||||||
|
|
||||||
let label = new St.Label({
|
let label = new St.Label({
|
||||||
text: message,
|
text: message,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* exported MessageListSection */
|
/* exported MessageListSection */
|
||||||
const { Atk, Clutter, Gio, GLib,
|
const {
|
||||||
GObject, Graphene, Meta, Pango, St } = imports.gi;
|
Atk, Clutter, Gio, GLib, GObject, Graphene, Meta, Pango, St,
|
||||||
|
} = imports.gi;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
|
|
||||||
@ -331,18 +332,25 @@ var Message = GObject.registerClass({
|
|||||||
let hbox = new St.BoxLayout();
|
let hbox = new St.BoxLayout();
|
||||||
vbox.add_actor(hbox);
|
vbox.add_actor(hbox);
|
||||||
|
|
||||||
this._actionBin = new St.Widget({ layout_manager: new ScaleLayout(),
|
this._actionBin = new St.Widget({
|
||||||
visible: false });
|
layout_manager: new ScaleLayout(),
|
||||||
|
visible: false,
|
||||||
|
});
|
||||||
vbox.add_actor(this._actionBin);
|
vbox.add_actor(this._actionBin);
|
||||||
|
|
||||||
this._iconBin = new St.Bin({ style_class: 'message-icon-bin',
|
this._iconBin = new St.Bin({
|
||||||
|
style_class: 'message-icon-bin',
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
y_align: Clutter.ActorAlign.START,
|
y_align: Clutter.ActorAlign.START,
|
||||||
visible: false });
|
visible: false,
|
||||||
|
});
|
||||||
hbox.add_actor(this._iconBin);
|
hbox.add_actor(this._iconBin);
|
||||||
|
|
||||||
let contentBox = new St.BoxLayout({ style_class: 'message-content',
|
const contentBox = new St.BoxLayout({
|
||||||
vertical: true, x_expand: true });
|
style_class: 'message-content',
|
||||||
|
vertical: true,
|
||||||
|
x_expand: true,
|
||||||
|
});
|
||||||
hbox.add_actor(contentBox);
|
hbox.add_actor(contentBox);
|
||||||
|
|
||||||
this._mediaControls = new St.BoxLayout();
|
this._mediaControls = new St.BoxLayout();
|
||||||
@ -361,8 +369,10 @@ var Message = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
titleBox.add_actor(this._secondaryBin);
|
titleBox.add_actor(this._secondaryBin);
|
||||||
|
|
||||||
let closeIcon = new St.Icon({ icon_name: 'window-close-symbolic',
|
const closeIcon = new St.Icon({
|
||||||
icon_size: 16 });
|
icon_name: 'window-close-symbolic',
|
||||||
|
icon_size: 16,
|
||||||
|
});
|
||||||
this._closeButton = new St.Button({
|
this._closeButton = new St.Button({
|
||||||
style_class: 'message-close-button',
|
style_class: 'message-close-button',
|
||||||
child: closeIcon, opacity: 0,
|
child: closeIcon, opacity: 0,
|
||||||
@ -435,8 +445,10 @@ var Message = GObject.registerClass({
|
|||||||
|
|
||||||
addMediaControl(iconName, callback) {
|
addMediaControl(iconName, callback) {
|
||||||
let icon = new St.Icon({ icon_name: iconName, icon_size: 16 });
|
let icon = new St.Icon({ icon_name: iconName, icon_size: 16 });
|
||||||
let button = new St.Button({ style_class: 'message-media-control',
|
const button = new St.Button({
|
||||||
child: icon });
|
style_class: 'message-media-control',
|
||||||
|
child: icon,
|
||||||
|
});
|
||||||
button.connect('clicked', callback);
|
button.connect('clicked', callback);
|
||||||
this._mediaControls.add_actor(button);
|
this._mediaControls.add_actor(button);
|
||||||
return button;
|
return button;
|
||||||
@ -565,8 +577,10 @@ var MessageListSection = GObject.registerClass({
|
|||||||
x_expand: true,
|
x_expand: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._list = new St.BoxLayout({ style_class: 'message-list-section-list',
|
this._list = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'message-list-section-list',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
this.add_actor(this._list);
|
this.add_actor(this._list);
|
||||||
|
|
||||||
this._list.connect('actor-added', this._sync.bind(this));
|
this._list.connect('actor-added', this._sync.bind(this));
|
||||||
|
@ -394,13 +394,15 @@ var Notification = GObject.registerClass({
|
|||||||
// the title/banner. If @params.clear is %true, it will also
|
// the title/banner. If @params.clear is %true, it will also
|
||||||
// remove any additional actors/action buttons previously added.
|
// remove any additional actors/action buttons previously added.
|
||||||
update(title, banner, params) {
|
update(title, banner, params) {
|
||||||
params = Params.parse(params, { gicon: null,
|
params = Params.parse(params, {
|
||||||
|
gicon: null,
|
||||||
secondaryGIcon: null,
|
secondaryGIcon: null,
|
||||||
bannerMarkup: false,
|
bannerMarkup: false,
|
||||||
clear: false,
|
clear: false,
|
||||||
datetime: null,
|
datetime: null,
|
||||||
soundName: null,
|
soundName: null,
|
||||||
soundFile: null });
|
soundFile: null,
|
||||||
|
});
|
||||||
|
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.bannerBodyText = banner;
|
this.bannerBodyText = banner;
|
||||||
@ -561,16 +563,20 @@ var NotificationBanner = GObject.registerClass({
|
|||||||
|
|
||||||
_addSecondaryIcon() {
|
_addSecondaryIcon() {
|
||||||
if (this.notification.secondaryGIcon) {
|
if (this.notification.secondaryGIcon) {
|
||||||
let icon = new St.Icon({ gicon: this.notification.secondaryGIcon,
|
const icon = new St.Icon({
|
||||||
x_align: Clutter.ActorAlign.END });
|
gicon: this.notification.secondaryGIcon,
|
||||||
|
x_align: Clutter.ActorAlign.END,
|
||||||
|
});
|
||||||
this.setSecondaryActor(icon);
|
this.setSecondaryActor(icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addButton(button, callback) {
|
addButton(button, callback) {
|
||||||
if (!this._buttonBox) {
|
if (!this._buttonBox) {
|
||||||
this._buttonBox = new St.BoxLayout({ style_class: 'notification-actions',
|
this._buttonBox = new St.BoxLayout({
|
||||||
x_expand: true });
|
style_class: 'notification-actions',
|
||||||
|
x_expand: true,
|
||||||
|
});
|
||||||
this.setActionArea(this._buttonBox);
|
this.setActionArea(this._buttonBox);
|
||||||
global.focus_manager.add_group(this._buttonBox);
|
global.focus_manager.add_group(this._buttonBox);
|
||||||
}
|
}
|
||||||
@ -596,10 +602,12 @@ var NotificationBanner = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
addAction(label, callback) {
|
addAction(label, callback) {
|
||||||
let button = new St.Button({ style_class: 'notification-button',
|
const button = new St.Button({
|
||||||
|
style_class: 'notification-button',
|
||||||
label,
|
label,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
can_focus: true });
|
can_focus: true,
|
||||||
|
});
|
||||||
|
|
||||||
return this.addButton(button, callback);
|
return this.addButton(button, callback);
|
||||||
}
|
}
|
||||||
@ -620,9 +628,11 @@ class SourceActor extends St.Widget {
|
|||||||
this._actorDestroyed = false;
|
this._actorDestroyed = false;
|
||||||
|
|
||||||
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
||||||
this._iconBin = new St.Bin({ x_expand: true,
|
this._iconBin = new St.Bin({
|
||||||
|
x_expand: true,
|
||||||
height: size * scaleFactor,
|
height: size * scaleFactor,
|
||||||
width: size * scaleFactor });
|
width: size * scaleFactor,
|
||||||
|
});
|
||||||
|
|
||||||
this.add_actor(this._iconBin);
|
this.add_actor(this._iconBin);
|
||||||
|
|
||||||
@ -732,8 +742,10 @@ var Source = GObject.registerClass({
|
|||||||
// Provides a sane default implementation, override if you need
|
// Provides a sane default implementation, override if you need
|
||||||
// something more fancy.
|
// something more fancy.
|
||||||
createIcon(size) {
|
createIcon(size) {
|
||||||
return new St.Icon({ gicon: this.getIcon(),
|
return new St.Icon({
|
||||||
icon_size: size });
|
gicon: this.getIcon(),
|
||||||
|
icon_size: size,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getIcon() {
|
getIcon() {
|
||||||
@ -836,14 +848,16 @@ var MessageTray = GObject.registerClass({
|
|||||||
GObject.BindingFlags.SYNC_CREATE);
|
GObject.BindingFlags.SYNC_CREATE);
|
||||||
this.add_constraint(constraint);
|
this.add_constraint(constraint);
|
||||||
|
|
||||||
this._bannerBin = new St.Widget({ name: 'notification-container',
|
this._bannerBin = new St.Widget({
|
||||||
|
name: 'notification-container',
|
||||||
reactive: true,
|
reactive: true,
|
||||||
track_hover: true,
|
track_hover: true,
|
||||||
y_align: Clutter.ActorAlign.START,
|
y_align: Clutter.ActorAlign.START,
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
layout_manager: new Clutter.BinLayout() });
|
layout_manager: new Clutter.BinLayout(),
|
||||||
|
});
|
||||||
this._bannerBin.connect('key-release-event',
|
this._bannerBin.connect('key-release-event',
|
||||||
this._onNotificationKeyRelease.bind(this));
|
this._onNotificationKeyRelease.bind(this));
|
||||||
this._bannerBin.connect('notify::hover',
|
this._bannerBin.connect('notify::hover',
|
||||||
|
@ -31,19 +31,22 @@ var ModalDialog = GObject.registerClass({
|
|||||||
Signals: { 'opened': {}, 'closed': {} },
|
Signals: { 'opened': {}, 'closed': {} },
|
||||||
}, class ModalDialog extends St.Widget {
|
}, class ModalDialog extends St.Widget {
|
||||||
_init(params) {
|
_init(params) {
|
||||||
super._init({ visible: false,
|
super._init({
|
||||||
|
visible: false,
|
||||||
reactive: true,
|
reactive: true,
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
accessible_role: Atk.Role.DIALOG,
|
accessible_role: Atk.Role.DIALOG,
|
||||||
});
|
});
|
||||||
|
|
||||||
params = Params.parse(params, { shellReactive: false,
|
params = Params.parse(params, {
|
||||||
|
shellReactive: false,
|
||||||
styleClass: null,
|
styleClass: null,
|
||||||
actionMode: Shell.ActionMode.SYSTEM_MODAL,
|
actionMode: Shell.ActionMode.SYSTEM_MODAL,
|
||||||
shouldFadeIn: true,
|
shouldFadeIn: true,
|
||||||
shouldFadeOut: true,
|
shouldFadeOut: true,
|
||||||
destroyOnClose: true });
|
destroyOnClose: true,
|
||||||
|
});
|
||||||
|
|
||||||
this._state = State.CLOSED;
|
this._state = State.CLOSED;
|
||||||
this._hasModal = false;
|
this._hasModal = false;
|
||||||
@ -55,8 +58,10 @@ var ModalDialog = GObject.registerClass({
|
|||||||
|
|
||||||
Main.layoutManager.modalDialogGroup.add_actor(this);
|
Main.layoutManager.modalDialogGroup.add_actor(this);
|
||||||
|
|
||||||
let constraint = new Clutter.BindConstraint({ source: global.stage,
|
const constraint = new Clutter.BindConstraint({
|
||||||
coordinate: Clutter.BindCoordinate.ALL });
|
source: global.stage,
|
||||||
|
coordinate: Clutter.BindCoordinate.ALL,
|
||||||
|
});
|
||||||
this.add_constraint(constraint);
|
this.add_constraint(constraint);
|
||||||
|
|
||||||
this.backgroundStack = new St.Widget({
|
this.backgroundStack = new St.Widget({
|
||||||
@ -74,9 +79,10 @@ var ModalDialog = GObject.registerClass({
|
|||||||
this.buttonLayout = this.dialogLayout.buttonLayout;
|
this.buttonLayout = this.dialogLayout.buttonLayout;
|
||||||
|
|
||||||
if (!this._shellReactive) {
|
if (!this._shellReactive) {
|
||||||
this._lightbox = new Lightbox.Lightbox(this,
|
this._lightbox = new Lightbox.Lightbox(this, {
|
||||||
{ inhibitEvents: true,
|
inhibitEvents: true,
|
||||||
radialEffect: true });
|
radialEffect: true,
|
||||||
|
});
|
||||||
this._lightbox.highlight(this._backgroundBin);
|
this._lightbox.highlight(this._backgroundBin);
|
||||||
|
|
||||||
this._eventBlocker = new Clutter.Actor({ reactive: true });
|
this._eventBlocker = new Clutter.Actor({ reactive: true });
|
||||||
|
@ -171,13 +171,15 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
|||||||
hints['image-data'] = hints['icon_data'];
|
hints['image-data'] = hints['icon_data'];
|
||||||
}
|
}
|
||||||
|
|
||||||
let ndata = { appName,
|
const ndata = {
|
||||||
|
appName,
|
||||||
icon,
|
icon,
|
||||||
summary,
|
summary,
|
||||||
body,
|
body,
|
||||||
actions,
|
actions,
|
||||||
hints,
|
hints,
|
||||||
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;
|
||||||
@ -458,8 +460,10 @@ class FdoNotificationDaemonSource extends MessageTray.Source {
|
|||||||
if (this.app) {
|
if (this.app) {
|
||||||
return this.app.create_icon_texture(size);
|
return this.app.create_icon_texture(size);
|
||||||
} else if (this._gicon) {
|
} else if (this._gicon) {
|
||||||
return new St.Icon({ gicon: this._gicon,
|
return new St.Icon({
|
||||||
icon_size: size });
|
gicon: this._gicon,
|
||||||
|
icon_size: size,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -479,15 +483,17 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
|
|||||||
super._init(source);
|
super._init(source);
|
||||||
this._serialized = GLib.Variant.new('a{sv}', notification);
|
this._serialized = GLib.Variant.new('a{sv}', notification);
|
||||||
|
|
||||||
let { title,
|
const {
|
||||||
|
title,
|
||||||
body,
|
body,
|
||||||
icon: gicon,
|
icon: gicon,
|
||||||
urgent,
|
urgent,
|
||||||
priority,
|
priority,
|
||||||
buttons,
|
buttons,
|
||||||
"default-action": defaultAction,
|
'default-action': defaultAction,
|
||||||
"default-action-target": defaultActionTarget,
|
'default-action-target': defaultActionTarget,
|
||||||
timestamp: time } = notification;
|
timestamp: time,
|
||||||
|
} = notification;
|
||||||
|
|
||||||
if (priority) {
|
if (priority) {
|
||||||
let urgency = PRIORITY_URGENCY_MAP[priority.unpack()];
|
let urgency = PRIORITY_URGENCY_MAP[priority.unpack()];
|
||||||
@ -511,9 +517,12 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
|
|||||||
this._defaultAction = defaultAction?.unpack();
|
this._defaultAction = defaultAction?.unpack();
|
||||||
this._defaultActionTarget = defaultActionTarget;
|
this._defaultActionTarget = defaultActionTarget;
|
||||||
|
|
||||||
this.update(title.unpack(), body?.unpack(),
|
this.update(title.unpack(), body?.unpack(), {
|
||||||
{ gicon: gicon ? Gio.icon_deserialize(gicon) : null,
|
gicon: gicon
|
||||||
datetime: time ? GLib.DateTime.new_from_unix_local(time.unpack()) : null });
|
? Gio.icon_deserialize(gicon) : null,
|
||||||
|
datetime: time
|
||||||
|
? GLib.DateTime.new_from_unix_local(time.unpack()) : null,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_activateAction(namespacedActionId, target) {
|
_activateAction(namespacedActionId, target) {
|
||||||
|
@ -12,12 +12,16 @@ class OsdMonitorLabel extends St.Widget {
|
|||||||
|
|
||||||
this._monitor = monitor;
|
this._monitor = monitor;
|
||||||
|
|
||||||
this._box = new St.BoxLayout({ style_class: 'osd-window',
|
this._box = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'osd-window',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
this.add_actor(this._box);
|
this.add_actor(this._box);
|
||||||
|
|
||||||
this._label = new St.Label({ style_class: 'osd-monitor-label',
|
this._label = new St.Label({
|
||||||
text: label });
|
style_class: 'osd-monitor-label',
|
||||||
|
text: label,
|
||||||
|
});
|
||||||
this._box.add(this._label);
|
this._box.add(this._label);
|
||||||
|
|
||||||
Main.uiGroup.add_child(this);
|
Main.uiGroup.add_child(this);
|
||||||
|
@ -159,8 +159,10 @@ var Overview = class {
|
|||||||
// During transitions, we raise this to the top to avoid having the overview
|
// During transitions, we raise this to the top to avoid having the overview
|
||||||
// area be reactive; it causes too many issues such as double clicks on
|
// area be reactive; it causes too many issues such as double clicks on
|
||||||
// Dash elements, or mouseover handlers in the workspaces.
|
// Dash elements, or mouseover handlers in the workspaces.
|
||||||
this._coverPane = new Clutter.Actor({ opacity: 0,
|
this._coverPane = new Clutter.Actor({
|
||||||
reactive: true });
|
opacity: 0,
|
||||||
|
reactive: true,
|
||||||
|
});
|
||||||
Main.layoutManager.overviewGroup.add_child(this._coverPane);
|
Main.layoutManager.overviewGroup.add_child(this._coverPane);
|
||||||
this._coverPane.connect('event', (_actor, event) => {
|
this._coverPane.connect('event', (_actor, event) => {
|
||||||
return event.type() === Clutter.EventType.ENTER ||
|
return event.type() === Clutter.EventType.ENTER ||
|
||||||
@ -329,8 +331,11 @@ var Overview = class {
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
let window = windows[0];
|
let window = windows[0];
|
||||||
let clone = new Clutter.Clone({ source: window,
|
const clone = new Clutter.Clone({
|
||||||
x: window.x, y: window.y });
|
source: window,
|
||||||
|
x: window.x,
|
||||||
|
y: window.y,
|
||||||
|
});
|
||||||
clone.source.connect('destroy', () => {
|
clone.source.connect('destroy', () => {
|
||||||
clone.destroy();
|
clone.destroy();
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported PadOsd, PadOsdService */
|
/* exported PadOsd, PadOsdService */
|
||||||
|
|
||||||
const { Atk, Clutter, GDesktopEnums, Gio,
|
const {
|
||||||
GLib, GObject, Gtk, Meta, Pango, Rsvg, St } = imports.gi;
|
Atk, Clutter, GDesktopEnums, Gio,
|
||||||
|
GLib, GObject, Gtk, Meta, Pango, Rsvg, St,
|
||||||
|
} = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -116,19 +118,23 @@ var ActionComboBox = GObject.registerClass({
|
|||||||
super._init({ style_class: 'button' });
|
super._init({ style_class: 'button' });
|
||||||
this.set_toggle_mode(true);
|
this.set_toggle_mode(true);
|
||||||
|
|
||||||
let boxLayout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.HORIZONTAL,
|
const boxLayout = new Clutter.BoxLayout({
|
||||||
spacing: 6 });
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
|
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);
|
||||||
|
|
||||||
let arrow = new St.Icon({ style_class: 'popup-menu-arrow',
|
const arrow = new St.Icon({
|
||||||
|
style_class: 'popup-menu-arrow',
|
||||||
icon_name: 'pan-down-symbolic',
|
icon_name: 'pan-down-symbolic',
|
||||||
accessible_role: Atk.Role.ARROW,
|
accessible_role: Atk.Role.ARROW,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
box.add_child(arrow);
|
box.add_child(arrow);
|
||||||
|
|
||||||
this._editMenu = new PopupMenu.PopupMenu(this, 0, St.Side.TOP);
|
this._editMenu = new PopupMenu.PopupMenu(this, 0, St.Side.TOP);
|
||||||
@ -195,8 +201,10 @@ var ActionEditor = GObject.registerClass({
|
|||||||
Signals: { 'done': {} },
|
Signals: { 'done': {} },
|
||||||
}, class ActionEditor extends St.Widget {
|
}, class ActionEditor extends St.Widget {
|
||||||
_init() {
|
_init() {
|
||||||
let boxLayout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.HORIZONTAL,
|
const boxLayout = new Clutter.BoxLayout({
|
||||||
spacing: 12 });
|
orientation: Clutter.Orientation.HORIZONTAL,
|
||||||
|
spacing: 12,
|
||||||
|
});
|
||||||
|
|
||||||
super._init({ layout_manager: boxLayout });
|
super._init({ layout_manager: boxLayout });
|
||||||
|
|
||||||
@ -208,9 +216,11 @@ var ActionEditor = GObject.registerClass({
|
|||||||
this._keybindingEdit.connect('keybinding-edited', this._onKeybindingEdited.bind(this));
|
this._keybindingEdit.connect('keybinding-edited', this._onKeybindingEdited.bind(this));
|
||||||
this.add_actor(this._keybindingEdit);
|
this.add_actor(this._keybindingEdit);
|
||||||
|
|
||||||
this._doneButton = new St.Button({ label: _("Done"),
|
this._doneButton = new St.Button({
|
||||||
|
label: _('Done'),
|
||||||
style_class: 'button',
|
style_class: 'button',
|
||||||
x_expand: false });
|
x_expand: false,
|
||||||
|
});
|
||||||
this._doneButton.connect('clicked', this._onEditingDone.bind(this));
|
this._doneButton.connect('clicked', this._onEditingDone.bind(this));
|
||||||
this.add_actor(this._doneButton);
|
this.add_actor(this._doneButton);
|
||||||
}
|
}
|
||||||
@ -675,18 +685,24 @@ var PadOsd = GObject.registerClass({
|
|||||||
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({ style_class: 'pad-osd-title-box',
|
this._titleBox = new St.BoxLayout({
|
||||||
|
style_class: 'pad-osd-title-box',
|
||||||
vertical: false,
|
vertical: false,
|
||||||
x_expand: false,
|
x_expand: false,
|
||||||
x_align: Clutter.ActorAlign.CENTER });
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this.add_actor(this._titleBox);
|
this.add_actor(this._titleBox);
|
||||||
|
|
||||||
let labelBox = new St.BoxLayout({ style_class: 'pad-osd-title-menu-box',
|
const labelBox = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'pad-osd-title-menu-box',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
this._titleBox.add_actor(labelBox);
|
this._titleBox.add_actor(labelBox);
|
||||||
|
|
||||||
this._titleLabel = new St.Label({ style: 'font-side: larger; font-weight: bold;',
|
this._titleLabel = new St.Label({
|
||||||
x_align: Clutter.ActorAlign.CENTER });
|
style: 'font-side: larger; font-weight: bold;',
|
||||||
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this._titleLabel.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
|
this._titleLabel.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
|
||||||
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);
|
||||||
@ -699,18 +715,22 @@ var PadOsd = GObject.registerClass({
|
|||||||
this._actionEditor = new ActionEditor();
|
this._actionEditor = new ActionEditor();
|
||||||
this._actionEditor.connect('done', this._endActionEdition.bind(this));
|
this._actionEditor.connect('done', this._endActionEdition.bind(this));
|
||||||
|
|
||||||
this._padDiagram = new PadDiagram({ image: this._imagePath,
|
this._padDiagram = new PadDiagram({
|
||||||
|
image: this._imagePath,
|
||||||
left_handed: settings.get_boolean('left-handed'),
|
left_handed: settings.get_boolean('left-handed'),
|
||||||
editor_actor: this._actionEditor,
|
editor_actor: this._actionEditor,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true });
|
y_expand: true,
|
||||||
|
});
|
||||||
this.add_actor(this._padDiagram);
|
this.add_actor(this._padDiagram);
|
||||||
this._updateActionLabels();
|
this._updateActionLabels();
|
||||||
|
|
||||||
let buttonBox = new St.Widget({ layout_manager: new Clutter.BinLayout(),
|
const buttonBox = new St.Widget({
|
||||||
|
layout_manager: new Clutter.BinLayout(),
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this.add_actor(buttonBox);
|
this.add_actor(buttonBox);
|
||||||
this._editButton = new St.Button({
|
this._editButton = new St.Button({
|
||||||
label: _('Edit…'),
|
label: _('Edit…'),
|
||||||
|
@ -54,11 +54,13 @@ var PageIndicators = GObject.registerClass({
|
|||||||
if (diff > 0) {
|
if (diff > 0) {
|
||||||
for (let i = 0; i < diff; i++) {
|
for (let i = 0; i < diff; i++) {
|
||||||
let pageIndex = this._nPages + i;
|
let pageIndex = this._nPages + i;
|
||||||
let indicator = new St.Button({ style_class: 'page-indicator',
|
const indicator = new St.Button({
|
||||||
|
style_class: 'page-indicator',
|
||||||
button_mask: St.ButtonMask.ONE |
|
button_mask: St.ButtonMask.ONE |
|
||||||
St.ButtonMask.TWO |
|
St.ButtonMask.TWO |
|
||||||
St.ButtonMask.THREE,
|
St.ButtonMask.THREE,
|
||||||
reactive: this._reactive });
|
reactive: this._reactive,
|
||||||
|
});
|
||||||
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 }),
|
||||||
|
@ -66,8 +66,10 @@ var AppMenuButton = GObject.registerClass({
|
|||||||
iconEffect.enabled = themeNode.get_icon_style() == St.IconStyle.SYMBOLIC;
|
iconEffect.enabled = themeNode.get_icon_style() == St.IconStyle.SYMBOLIC;
|
||||||
});
|
});
|
||||||
|
|
||||||
this._label = new St.Label({ y_expand: true,
|
this._label = new St.Label({
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_expand: true,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this._container.add_actor(this._label);
|
this._container.add_actor(this._label);
|
||||||
|
|
||||||
this._visible = !Main.overview.visible;
|
this._visible = !Main.overview.visible;
|
||||||
@ -267,8 +269,10 @@ class ActivitiesButton extends PanelMenu.Button {
|
|||||||
|
|
||||||
/* Translators: If there is no suitable word for "Activities"
|
/* Translators: If there is no suitable word for "Activities"
|
||||||
in your language, you can use the word for "Overview". */
|
in your language, you can use the word for "Overview". */
|
||||||
this._label = new St.Label({ text: _("Activities"),
|
this._label = new St.Label({
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
text: _('Activities'),
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this.add_actor(this._label);
|
this.add_actor(this._label);
|
||||||
|
|
||||||
this.label_actor = this._label;
|
this.label_actor = this._label;
|
||||||
@ -474,8 +478,10 @@ const PANEL_ITEM_IMPLEMENTATIONS = {
|
|||||||
var Panel = GObject.registerClass(
|
var Panel = GObject.registerClass(
|
||||||
class Panel extends St.Widget {
|
class Panel extends St.Widget {
|
||||||
_init() {
|
_init() {
|
||||||
super._init({ name: 'panel',
|
super._init({
|
||||||
reactive: true });
|
name: 'panel',
|
||||||
|
reactive: true,
|
||||||
|
});
|
||||||
|
|
||||||
this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
|
this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
|
||||||
|
|
||||||
|
@ -47,11 +47,13 @@ function arrowIcon(side) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let arrow = new St.Icon({ style_class: 'popup-menu-arrow',
|
const arrow = new St.Icon({
|
||||||
|
style_class: 'popup-menu-arrow',
|
||||||
icon_name: iconName,
|
icon_name: iconName,
|
||||||
accessible_role: Atk.Role.ARROW,
|
accessible_role: Atk.Role.ARROW,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
|
|
||||||
return arrow;
|
return arrow;
|
||||||
}
|
}
|
||||||
@ -77,11 +79,13 @@ var PopupBaseMenuItem = GObject.registerClass({
|
|||||||
style_class: null,
|
style_class: null,
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
});
|
});
|
||||||
super._init({ style_class: 'popup-menu-item',
|
super._init({
|
||||||
|
style_class: 'popup-menu-item',
|
||||||
reactive: params.reactive,
|
reactive: params.reactive,
|
||||||
track_hover: params.reactive,
|
track_hover: params.reactive,
|
||||||
can_focus: params.can_focus,
|
can_focus: params.can_focus,
|
||||||
accessible_role: Atk.Role.MENU_ITEM });
|
accessible_role: Atk.Role.MENU_ITEM,
|
||||||
|
});
|
||||||
this._delegate = this;
|
this._delegate = this;
|
||||||
|
|
||||||
this._ornament = Ornament.NONE;
|
this._ornament = Ornament.NONE;
|
||||||
@ -451,8 +455,10 @@ class PopupImageMenuItem extends PopupBaseMenuItem {
|
|||||||
_init(text, icon, params) {
|
_init(text, icon, params) {
|
||||||
super._init(params);
|
super._init(params);
|
||||||
|
|
||||||
this._icon = new St.Icon({ style_class: 'popup-menu-icon',
|
this._icon = new St.Icon({
|
||||||
x_align: Clutter.ActorAlign.END });
|
style_class: 'popup-menu-icon',
|
||||||
|
x_align: Clutter.ActorAlign.END,
|
||||||
|
});
|
||||||
this.add_child(this._icon);
|
this.add_child(this._icon);
|
||||||
this.label = new St.Label({
|
this.label = new St.Label({
|
||||||
text,
|
text,
|
||||||
@ -1024,9 +1030,11 @@ var PopupSubMenu = class extends PopupMenuBase {
|
|||||||
// Since a function of a submenu might be to provide a "More.." expander
|
// Since a function of a submenu might be to provide a "More.." expander
|
||||||
// with long content, we make it scrollable - the scrollbar will only take
|
// with long content, we make it scrollable - the scrollbar will only take
|
||||||
// effect if a CSS max-height is set on the top menu.
|
// effect if a CSS max-height is set on the top menu.
|
||||||
this.actor = new St.ScrollView({ style_class: 'popup-sub-menu',
|
this.actor = new St.ScrollView({
|
||||||
|
style_class: 'popup-sub-menu',
|
||||||
hscrollbar_policy: St.PolicyType.NEVER,
|
hscrollbar_policy: St.PolicyType.NEVER,
|
||||||
vscrollbar_policy: St.PolicyType.NEVER });
|
vscrollbar_policy: St.PolicyType.NEVER,
|
||||||
|
});
|
||||||
|
|
||||||
this.actor.add_actor(this.box);
|
this.actor.add_actor(this.box);
|
||||||
this.actor._delegate = this;
|
this.actor._delegate = this;
|
||||||
@ -1194,9 +1202,11 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
|
|||||||
this.add_child(this.icon);
|
this.add_child(this.icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.label = new St.Label({ 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);
|
||||||
this.label_actor = this.label;
|
this.label_actor = this.label;
|
||||||
|
|
||||||
@ -1209,8 +1219,10 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
|
|||||||
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({ y_expand: true,
|
this._triangleBin = new St.Widget({
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_expand: true,
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this._triangleBin.add_child(this._triangle);
|
this._triangleBin.add_child(this._triangle);
|
||||||
|
|
||||||
this.add_child(this._triangleBin);
|
this.add_child(this._triangleBin);
|
||||||
|
@ -198,12 +198,14 @@ var RemoteSearchProvider = class {
|
|||||||
else
|
else
|
||||||
gFlags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START;
|
gFlags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START;
|
||||||
|
|
||||||
this.proxy = new Gio.DBusProxy({ g_bus_type: Gio.BusType.SESSION,
|
this.proxy = new Gio.DBusProxy({
|
||||||
|
g_bus_type: Gio.BusType.SESSION,
|
||||||
g_name: dbusName,
|
g_name: dbusName,
|
||||||
g_object_path: dbusPath,
|
g_object_path: dbusPath,
|
||||||
g_interface_info: proxyInfo,
|
g_interface_info: proxyInfo,
|
||||||
g_interface_name: proxyInfo.name,
|
g_interface_name: proxyInfo.name,
|
||||||
gFlags });
|
gFlags,
|
||||||
|
});
|
||||||
this.proxy.init_async(GLib.PRIORITY_DEFAULT, null);
|
this.proxy.init_async(GLib.PRIORITY_DEFAULT, null);
|
||||||
|
|
||||||
this.appInfo = appInfo;
|
this.appInfo = appInfo;
|
||||||
@ -289,13 +291,13 @@ var RemoteSearchProvider = class {
|
|||||||
metas[i][prop] = metas[i][prop].deep_unpack();
|
metas[i][prop] = metas[i][prop].deep_unpack();
|
||||||
}
|
}
|
||||||
|
|
||||||
resultMetas.push({ id: metas[i]['id'],
|
resultMetas.push({
|
||||||
|
id: metas[i]['id'],
|
||||||
name: metas[i]['name'],
|
name: metas[i]['name'],
|
||||||
description: metas[i]['description'],
|
description: metas[i]['description'],
|
||||||
createIcon: size => {
|
createIcon: size => this.createIcon(size, metas[i]),
|
||||||
return this.createIcon(size, metas[i]);
|
clipboardText: metas[i]['clipboardText'],
|
||||||
},
|
});
|
||||||
clipboardText: metas[i]['clipboardText'] });
|
|
||||||
}
|
}
|
||||||
callback(resultMetas);
|
callback(resultMetas);
|
||||||
}
|
}
|
||||||
|
@ -12,25 +12,31 @@ var Ripples = class Ripples {
|
|||||||
this._px = px;
|
this._px = px;
|
||||||
this._py = py;
|
this._py = py;
|
||||||
|
|
||||||
this._ripple1 = new St.BoxLayout({ style_class: styleClass,
|
this._ripple1 = new St.BoxLayout({
|
||||||
|
style_class: styleClass,
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
can_focus: false,
|
can_focus: false,
|
||||||
reactive: false,
|
reactive: false,
|
||||||
visible: false });
|
visible: false,
|
||||||
|
});
|
||||||
this._ripple1.set_pivot_point(px, py);
|
this._ripple1.set_pivot_point(px, py);
|
||||||
|
|
||||||
this._ripple2 = new St.BoxLayout({ style_class: styleClass,
|
this._ripple2 = new St.BoxLayout({
|
||||||
|
style_class: styleClass,
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
can_focus: false,
|
can_focus: false,
|
||||||
reactive: false,
|
reactive: false,
|
||||||
visible: false });
|
visible: false,
|
||||||
|
});
|
||||||
this._ripple2.set_pivot_point(px, py);
|
this._ripple2.set_pivot_point(px, py);
|
||||||
|
|
||||||
this._ripple3 = new St.BoxLayout({ style_class: styleClass,
|
this._ripple3 = new St.BoxLayout({
|
||||||
|
style_class: styleClass,
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
can_focus: false,
|
can_focus: false,
|
||||||
reactive: false,
|
reactive: false,
|
||||||
visible: false });
|
visible: false,
|
||||||
|
});
|
||||||
this._ripple3.set_pivot_point(px, py);
|
this._ripple3.set_pivot_point(px, py);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const { AccountsService, Clutter, Gio,
|
const {
|
||||||
GLib, Graphene, Meta, Shell, St } = imports.gi;
|
AccountsService, Clutter, Gio,
|
||||||
|
GLib, Graphene, Meta, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const GnomeSession = imports.misc.gnomeSession;
|
const GnomeSession = imports.misc.gnomeSession;
|
||||||
@ -130,13 +132,15 @@ var ScreenShield = class {
|
|||||||
// The "long" lightbox is used for the longer (20 seconds) fade from session
|
// The "long" lightbox is used for the longer (20 seconds) fade from session
|
||||||
// to idle status, the "short" is used for quickly fading to black when locking
|
// to idle status, the "short" is used for quickly fading to black when locking
|
||||||
// manually
|
// manually
|
||||||
this._longLightbox = new Lightbox.Lightbox(Main.uiGroup,
|
this._longLightbox = new Lightbox.Lightbox(Main.uiGroup, {
|
||||||
{ inhibitEvents: true,
|
inhibitEvents: true,
|
||||||
fadeFactor: 1 });
|
fadeFactor: 1,
|
||||||
|
});
|
||||||
this._longLightbox.connect('notify::active', this._onLongLightbox.bind(this));
|
this._longLightbox.connect('notify::active', this._onLongLightbox.bind(this));
|
||||||
this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup,
|
this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup, {
|
||||||
{ inhibitEvents: true,
|
inhibitEvents: true,
|
||||||
fadeFactor: 1 });
|
fadeFactor: 1,
|
||||||
|
});
|
||||||
this._shortLightbox.connect('notify::active', this._onShortLightbox.bind(this));
|
this._shortLightbox.connect('notify::active', this._onShortLightbox.bind(this));
|
||||||
|
|
||||||
this.idleMonitor = global.backend.get_core_idle_monitor();
|
this.idleMonitor = global.backend.get_core_idle_monitor();
|
||||||
@ -440,8 +444,10 @@ var ScreenShield = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onUnlockFailed() {
|
_onUnlockFailed() {
|
||||||
this._resetLockScreen({ animateLockScreen: true,
|
this._resetLockScreen({
|
||||||
fadeToBlack: false });
|
animateLockScreen: true,
|
||||||
|
fadeToBlack: false,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_resetLockScreen(params) {
|
_resetLockScreen(params) {
|
||||||
@ -606,8 +612,10 @@ var ScreenShield = class {
|
|||||||
Main.sessionMode.pushMode('unlock-dialog');
|
Main.sessionMode.pushMode('unlock-dialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
this._resetLockScreen({ animateLockScreen: animate,
|
this._resetLockScreen({
|
||||||
fadeToBlack: true });
|
animateLockScreen: animate,
|
||||||
|
fadeToBlack: true,
|
||||||
|
});
|
||||||
// On wayland, a crash brings down the entire session, so we don't
|
// On wayland, a crash brings down the entire session, so we don't
|
||||||
// need to defend against being restarted unlocked
|
// need to defend against being restarted unlocked
|
||||||
if (!Meta.is_wayland_compositor())
|
if (!Meta.is_wayland_compositor())
|
||||||
|
@ -2542,8 +2542,10 @@ class SelectArea extends St.Widget {
|
|||||||
|
|
||||||
this._grabHelper = new GrabHelper.GrabHelper(this);
|
this._grabHelper = new GrabHelper.GrabHelper(this);
|
||||||
|
|
||||||
let constraint = new Clutter.BindConstraint({ source: global.stage,
|
const constraint = new Clutter.BindConstraint({
|
||||||
coordinate: Clutter.BindCoordinate.ALL });
|
source: global.stage,
|
||||||
|
coordinate: Clutter.BindCoordinate.ALL,
|
||||||
|
});
|
||||||
this.add_constraint(constraint);
|
this.add_constraint(constraint);
|
||||||
|
|
||||||
this._rubberband = new St.Widget({
|
this._rubberband = new St.Widget({
|
||||||
@ -2768,8 +2770,10 @@ class PickPixel extends St.Widget {
|
|||||||
|
|
||||||
this._grabHelper = new GrabHelper.GrabHelper(this);
|
this._grabHelper = new GrabHelper.GrabHelper(this);
|
||||||
|
|
||||||
let constraint = new Clutter.BindConstraint({ source: global.stage,
|
const constraint = new Clutter.BindConstraint({
|
||||||
coordinate: Clutter.BindCoordinate.ALL });
|
source: global.stage,
|
||||||
|
coordinate: Clutter.BindCoordinate.ALL,
|
||||||
|
});
|
||||||
this.add_constraint(constraint);
|
this.add_constraint(constraint);
|
||||||
|
|
||||||
const action = new Clutter.ClickAction();
|
const action = new Clutter.ClickAction();
|
||||||
|
@ -112,11 +112,13 @@ function _callRemote(obj, method, ...args) {
|
|||||||
* until the window has been mapped and exposed, use waitTestWindows().
|
* until the window has been mapped and exposed, use waitTestWindows().
|
||||||
*/
|
*/
|
||||||
function createTestWindow(params) {
|
function createTestWindow(params) {
|
||||||
params = Params.parse(params, { width: 640,
|
params = Params.parse(params, {
|
||||||
|
width: 640,
|
||||||
height: 480,
|
height: 480,
|
||||||
alpha: false,
|
alpha: false,
|
||||||
maximized: false,
|
maximized: false,
|
||||||
redraws: false });
|
redraws: false,
|
||||||
|
});
|
||||||
|
|
||||||
let perfHelper = _getPerfHelper();
|
let perfHelper = _getPerfHelper();
|
||||||
return _callRemote(perfHelper, perfHelper.CreateWindowRemote,
|
return _callRemote(perfHelper, perfHelper.CreateWindowRemote,
|
||||||
|
@ -912,19 +912,27 @@ class ProviderInfo extends St.Button {
|
|||||||
y_align: Clutter.ActorAlign.START,
|
y_align: Clutter.ActorAlign.START,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._content = new St.BoxLayout({ vertical: false,
|
this._content = new St.BoxLayout({
|
||||||
style_class: 'list-search-provider-content' });
|
vertical: false,
|
||||||
|
style_class: 'list-search-provider-content',
|
||||||
|
});
|
||||||
this.set_child(this._content);
|
this.set_child(this._content);
|
||||||
|
|
||||||
let icon = new St.Icon({ icon_size: this.PROVIDER_ICON_SIZE,
|
const icon = new St.Icon({
|
||||||
gicon: provider.appInfo.get_icon() });
|
icon_size: this.PROVIDER_ICON_SIZE,
|
||||||
|
gicon: provider.appInfo.get_icon(),
|
||||||
|
});
|
||||||
|
|
||||||
let detailsBox = new St.BoxLayout({ style_class: 'list-search-provider-details',
|
const detailsBox = new St.BoxLayout({
|
||||||
|
style_class: 'list-search-provider-details',
|
||||||
vertical: true,
|
vertical: true,
|
||||||
x_expand: true });
|
x_expand: true,
|
||||||
|
});
|
||||||
|
|
||||||
let nameLabel = new St.Label({ text: provider.appInfo.get_name(),
|
const nameLabel = new St.Label({
|
||||||
x_align: Clutter.ActorAlign.START });
|
text: provider.appInfo.get_name(),
|
||||||
|
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 });
|
||||||
|
|
||||||
|
@ -117,11 +117,13 @@ var GnomeShell = class {
|
|||||||
for (let param in params)
|
for (let param in params)
|
||||||
params[param] = params[param].deep_unpack();
|
params[param] = params[param].deep_unpack();
|
||||||
|
|
||||||
let { connector,
|
const {
|
||||||
|
connector,
|
||||||
label,
|
label,
|
||||||
level,
|
level,
|
||||||
max_level: maxLevel,
|
max_level: maxLevel,
|
||||||
icon: serializedIcon } = params;
|
icon: serializedIcon,
|
||||||
|
} = params;
|
||||||
|
|
||||||
let monitorIndex = -1;
|
let monitorIndex = -1;
|
||||||
if (connector) {
|
if (connector) {
|
||||||
|
@ -38,8 +38,10 @@ class Indicator extends PanelMenu.SystemIndicator {
|
|||||||
this._sliderChanged.bind(this));
|
this._sliderChanged.bind(this));
|
||||||
this._slider.accessible_name = _("Brightness");
|
this._slider.accessible_name = _("Brightness");
|
||||||
|
|
||||||
let icon = new St.Icon({ icon_name: 'display-brightness-symbolic',
|
const icon = new St.Icon({
|
||||||
style_class: 'popup-menu-icon' });
|
icon_name: 'display-brightness-symbolic',
|
||||||
|
style_class: 'popup-menu-icon',
|
||||||
|
});
|
||||||
this._item.add(icon);
|
this._item.add(icon);
|
||||||
this._item.add_child(this._slider);
|
this._item.add_child(this._slider);
|
||||||
this._item.connect('button-press-event', (actor, event) => {
|
this._item.connect('button-press-event', (actor, event) => {
|
||||||
|
@ -35,8 +35,10 @@ class DwellClickIndicator extends PanelMenu.Button {
|
|||||||
_init() {
|
_init() {
|
||||||
super._init(0.5, _("Dwell Click"));
|
super._init(0.5, _("Dwell Click"));
|
||||||
|
|
||||||
this._icon = new St.Icon({ style_class: 'system-status-icon',
|
this._icon = new St.Icon({
|
||||||
icon_name: 'pointer-primary-click-symbolic' });
|
style_class: 'system-status-icon',
|
||||||
|
icon_name: 'pointer-primary-click-symbolic',
|
||||||
|
});
|
||||||
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 });
|
||||||
|
@ -892,8 +892,10 @@ class InputSourceIndicator extends PanelMenu.Button {
|
|||||||
let menuItem = new LayoutMenuItem(is.displayName, is.shortName);
|
let menuItem = new LayoutMenuItem(is.displayName, is.shortName);
|
||||||
menuItem.connect('activate', () => is.activate(true));
|
menuItem.connect('activate', () => is.activate(true));
|
||||||
|
|
||||||
let indicatorLabel = new St.Label({ text: is.shortName,
|
const indicatorLabel = new St.Label({
|
||||||
visible: false });
|
text: is.shortName,
|
||||||
|
visible: false,
|
||||||
|
});
|
||||||
|
|
||||||
this._menuItems[i] = menuItem;
|
this._menuItems[i] = menuItem;
|
||||||
this._indicatorLabels[i] = indicatorLabel;
|
this._indicatorLabels[i] = indicatorLabel;
|
||||||
|
@ -413,11 +413,15 @@ var GeolocationDialog = GObject.registerClass({
|
|||||||
|
|
||||||
this.contentLayout.add_child(content);
|
this.contentLayout.add_child(content);
|
||||||
|
|
||||||
let button = this.addButton({ label: _("Deny Access"),
|
const button = this.addButton({
|
||||||
|
label: _('Deny Access'),
|
||||||
action: this._onDenyClicked.bind(this),
|
action: this._onDenyClicked.bind(this),
|
||||||
key: Clutter.KEY_Escape });
|
key: Clutter.KEY_Escape,
|
||||||
this.addButton({ label: _("Grant Access"),
|
});
|
||||||
action: this._onGrantClicked.bind(this) });
|
this.addButton({
|
||||||
|
label: _('Grant Access'),
|
||||||
|
action: this._onGrantClicked.bind(this),
|
||||||
|
});
|
||||||
|
|
||||||
this.setInitialKeyFocus(button);
|
this.setInitialKeyFocus(button);
|
||||||
}
|
}
|
||||||
|
@ -700,9 +700,11 @@ var NMWirelessDialogItem = GObject.registerClass({
|
|||||||
this._network = network;
|
this._network = network;
|
||||||
this._ap = network.accessPoints[0];
|
this._ap = network.accessPoints[0];
|
||||||
|
|
||||||
super._init({ style_class: 'nm-dialog-item',
|
super._init({
|
||||||
|
style_class: 'nm-dialog-item',
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
reactive: true });
|
reactive: true,
|
||||||
|
});
|
||||||
|
|
||||||
let action = new Clutter.ClickAction();
|
let action = new Clutter.ClickAction();
|
||||||
action.connect('clicked', () => this.grab_key_focus());
|
action.connect('clicked', () => this.grab_key_focus());
|
||||||
@ -717,8 +719,10 @@ var NMWirelessDialogItem = GObject.registerClass({
|
|||||||
this.label_actor = this._label;
|
this.label_actor = this._label;
|
||||||
this.add_child(this._label);
|
this.add_child(this._label);
|
||||||
|
|
||||||
this._selectedIcon = new St.Icon({ style_class: 'nm-dialog-icon',
|
this._selectedIcon = new St.Icon({
|
||||||
icon_name: 'object-select-symbolic' });
|
style_class: 'nm-dialog-icon',
|
||||||
|
icon_name: 'object-select-symbolic',
|
||||||
|
});
|
||||||
this.add(this._selectedIcon);
|
this.add(this._selectedIcon);
|
||||||
|
|
||||||
this._icons = new St.BoxLayout({
|
this._icons = new St.BoxLayout({
|
||||||
@ -913,14 +917,20 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
|
|||||||
_buildLayout() {
|
_buildLayout() {
|
||||||
let headline = new St.BoxLayout({ style_class: 'nm-dialog-header-hbox' });
|
let headline = new St.BoxLayout({ style_class: 'nm-dialog-header-hbox' });
|
||||||
|
|
||||||
let icon = new St.Icon({ style_class: 'nm-dialog-header-icon',
|
const icon = new St.Icon({
|
||||||
icon_name: 'network-wireless-signal-excellent-symbolic' });
|
style_class: 'nm-dialog-header-icon',
|
||||||
|
icon_name: 'network-wireless-signal-excellent-symbolic',
|
||||||
|
});
|
||||||
|
|
||||||
let titleBox = new St.BoxLayout({ vertical: true });
|
let titleBox = new St.BoxLayout({ vertical: true });
|
||||||
let title = new St.Label({ style_class: 'nm-dialog-header',
|
const title = new St.Label({
|
||||||
text: _("Wi-Fi Networks") });
|
style_class: 'nm-dialog-header',
|
||||||
let subtitle = new St.Label({ style_class: 'nm-dialog-subheader',
|
text: _('Wi-Fi Networks'),
|
||||||
text: _("Select a network") });
|
});
|
||||||
|
const subtitle = new St.Label({
|
||||||
|
style_class: 'nm-dialog-subheader',
|
||||||
|
text: _('Select a network'),
|
||||||
|
});
|
||||||
titleBox.add(title);
|
titleBox.add(title);
|
||||||
titleBox.add(subtitle);
|
titleBox.add(subtitle);
|
||||||
|
|
||||||
@ -944,21 +954,27 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
|
|||||||
this._scrollView.add_actor(this._itemBox);
|
this._scrollView.add_actor(this._itemBox);
|
||||||
this._stack.add_child(this._scrollView);
|
this._stack.add_child(this._scrollView);
|
||||||
|
|
||||||
this._noNetworksBox = new St.BoxLayout({ vertical: true,
|
this._noNetworksBox = new St.BoxLayout({
|
||||||
|
vertical: true,
|
||||||
style_class: 'no-networks-box',
|
style_class: 'no-networks-box',
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
|
|
||||||
this._noNetworksSpinner = new Animation.Spinner(16);
|
this._noNetworksSpinner = new Animation.Spinner(16);
|
||||||
this._noNetworksBox.add_actor(this._noNetworksSpinner);
|
this._noNetworksBox.add_actor(this._noNetworksSpinner);
|
||||||
this._noNetworksBox.add_actor(new St.Label({ style_class: 'no-networks-label',
|
this._noNetworksBox.add_actor(new St.Label({
|
||||||
text: _("No Networks") }));
|
style_class: 'no-networks-label',
|
||||||
|
text: _('No Networks'),
|
||||||
|
}));
|
||||||
this._stack.add_child(this._noNetworksBox);
|
this._stack.add_child(this._noNetworksBox);
|
||||||
|
|
||||||
this._airplaneBox = new St.BoxLayout({ vertical: true,
|
this._airplaneBox = new St.BoxLayout({
|
||||||
|
vertical: true,
|
||||||
style_class: 'nm-dialog-airplane-box',
|
style_class: 'nm-dialog-airplane-box',
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this._airplaneIcon = new St.Icon({ icon_size: 48 });
|
this._airplaneIcon = new St.Icon({ icon_size: 48 });
|
||||||
this._airplaneHeadline = new St.Label({ style_class: 'nm-dialog-airplane-headline headline' });
|
this._airplaneHeadline = new St.Label({ style_class: 'nm-dialog-airplane-headline headline' });
|
||||||
this._airplaneText = new St.Label({ style_class: 'nm-dialog-airplane-text' });
|
this._airplaneText = new St.Label({ style_class: 'nm-dialog-airplane-text' });
|
||||||
@ -972,8 +988,10 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
|
|||||||
this._client.wireless_enabled = true;
|
this._client.wireless_enabled = true;
|
||||||
});
|
});
|
||||||
airplaneSubStack.add_actor(this._airplaneButton);
|
airplaneSubStack.add_actor(this._airplaneButton);
|
||||||
this._airplaneInactive = new St.Label({ style_class: 'nm-dialog-airplane-text',
|
this._airplaneInactive = new St.Label({
|
||||||
text: _("Use hardware switch to turn off") });
|
style_class: 'nm-dialog-airplane-text',
|
||||||
|
text: _('Use hardware switch to turn off'),
|
||||||
|
});
|
||||||
airplaneSubStack.add_actor(this._airplaneInactive);
|
airplaneSubStack.add_actor(this._airplaneInactive);
|
||||||
|
|
||||||
this._airplaneBox.add_child(this._airplaneIcon);
|
this._airplaneBox.add_child(this._airplaneIcon);
|
||||||
@ -984,12 +1002,16 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
this.contentLayout.add_child(this._stack);
|
this.contentLayout.add_child(this._stack);
|
||||||
|
|
||||||
this._disconnectButton = this.addButton({ action: () => this.close(),
|
this._disconnectButton = this.addButton({
|
||||||
label: _("Cancel"),
|
action: () => this.close(),
|
||||||
key: Clutter.KEY_Escape });
|
label: _('Cancel'),
|
||||||
this._connectButton = this.addButton({ action: this._connect.bind(this),
|
key: Clutter.KEY_Escape,
|
||||||
label: _("Connect"),
|
});
|
||||||
key: Clutter.KEY_Return });
|
this._connectButton = this.addButton({
|
||||||
|
action: this._connect.bind(this),
|
||||||
|
label: _('Connect'),
|
||||||
|
key: Clutter.KEY_Return,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_connect() {
|
_connect() {
|
||||||
|
@ -100,11 +100,15 @@ class SwitchMonitorSwitcher extends SwitcherPopup.SwitcherList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_addIcon(item) {
|
_addIcon(item) {
|
||||||
let box = new St.BoxLayout({ style_class: 'alt-tab-app',
|
const box = new St.BoxLayout({
|
||||||
vertical: true });
|
style_class: 'alt-tab-app',
|
||||||
|
vertical: true,
|
||||||
|
});
|
||||||
|
|
||||||
let icon = new St.Icon({ icon_name: item.icon,
|
const icon = new St.Icon({
|
||||||
icon_size: APP_ICON_SIZE });
|
icon_name: item.icon,
|
||||||
|
icon_size: APP_ICON_SIZE,
|
||||||
|
});
|
||||||
box.add_child(icon);
|
box.add_child(icon);
|
||||||
|
|
||||||
let text = new St.Label({
|
let text = new St.Label({
|
||||||
|
@ -33,9 +33,11 @@ var SwitcherPopup = GObject.registerClass({
|
|||||||
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
GTypeFlags: GObject.TypeFlags.ABSTRACT,
|
||||||
}, class SwitcherPopup extends St.Widget {
|
}, class SwitcherPopup extends St.Widget {
|
||||||
_init(items) {
|
_init(items) {
|
||||||
super._init({ style_class: 'switcher-popup',
|
super._init({
|
||||||
|
style_class: 'switcher-popup',
|
||||||
reactive: true,
|
reactive: true,
|
||||||
visible: false });
|
visible: false,
|
||||||
|
});
|
||||||
|
|
||||||
this._switcherList = null;
|
this._switcherList = null;
|
||||||
|
|
||||||
@ -359,8 +361,10 @@ var SwitcherPopup = GObject.registerClass({
|
|||||||
var SwitcherButton = GObject.registerClass(
|
var SwitcherButton = GObject.registerClass(
|
||||||
class SwitcherButton extends St.Button {
|
class SwitcherButton extends St.Button {
|
||||||
_init(square) {
|
_init(square) {
|
||||||
super._init({ style_class: 'item-box',
|
super._init({
|
||||||
reactive: true });
|
style_class: 'item-box',
|
||||||
|
reactive: true,
|
||||||
|
});
|
||||||
|
|
||||||
this._square = square;
|
this._square = square;
|
||||||
}
|
}
|
||||||
@ -374,17 +378,21 @@ class SwitcherButton extends St.Button {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var SwitcherList = GObject.registerClass({
|
var SwitcherList = GObject.registerClass({
|
||||||
Signals: { 'item-activated': { param_types: [GObject.TYPE_INT] },
|
Signals: {
|
||||||
|
'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({ style_class: 'switcher-list-item-container',
|
this._list = new St.BoxLayout({
|
||||||
|
style_class: 'switcher-list-item-container',
|
||||||
vertical: false,
|
vertical: false,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true });
|
y_expand: true,
|
||||||
|
});
|
||||||
|
|
||||||
let layoutManager = this._list.get_layout_manager();
|
let layoutManager = this._list.get_layout_manager();
|
||||||
|
|
||||||
@ -393,21 +401,27 @@ var SwitcherList = GObject.registerClass({
|
|||||||
this._list.spacing = this._list.get_theme_node().get_length('spacing');
|
this._list.spacing = this._list.get_theme_node().get_length('spacing');
|
||||||
});
|
});
|
||||||
|
|
||||||
this._scrollView = new St.ScrollView({ style_class: 'hfade',
|
this._scrollView = new St.ScrollView({
|
||||||
enable_mouse_scrolling: false });
|
style_class: 'hfade',
|
||||||
|
enable_mouse_scrolling: false,
|
||||||
|
});
|
||||||
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.NEVER);
|
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.NEVER);
|
||||||
|
|
||||||
this._scrollView.add_actor(this._list);
|
this._scrollView.add_actor(this._list);
|
||||||
this.add_actor(this._scrollView);
|
this.add_actor(this._scrollView);
|
||||||
|
|
||||||
// Those arrows indicate whether scrolling in one direction is possible
|
// Those arrows indicate whether scrolling in one direction is possible
|
||||||
this._leftArrow = new St.DrawingArea({ style_class: 'switcher-arrow',
|
this._leftArrow = new St.DrawingArea({
|
||||||
pseudo_class: 'highlighted' });
|
style_class: 'switcher-arrow',
|
||||||
|
pseudo_class: 'highlighted',
|
||||||
|
});
|
||||||
this._leftArrow.connect('repaint', () => {
|
this._leftArrow.connect('repaint', () => {
|
||||||
drawArrow(this._leftArrow, St.Side.LEFT);
|
drawArrow(this._leftArrow, St.Side.LEFT);
|
||||||
});
|
});
|
||||||
this._rightArrow = new St.DrawingArea({ style_class: 'switcher-arrow',
|
this._rightArrow = new St.DrawingArea({
|
||||||
pseudo_class: 'highlighted' });
|
style_class: 'switcher-arrow',
|
||||||
|
pseudo_class: 'highlighted',
|
||||||
|
});
|
||||||
this._rightArrow.connect('repaint', () => {
|
this._rightArrow.connect('repaint', () => {
|
||||||
drawArrow(this._rightArrow, St.Side.RIGHT);
|
drawArrow(this._rightArrow, St.Side.RIGHT);
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported UnlockDialog */
|
/* exported UnlockDialog */
|
||||||
|
|
||||||
const { AccountsService, Atk, Clutter, Gdm, Gio,
|
const {
|
||||||
GnomeDesktop, GLib, GObject, Meta, Shell, St } = imports.gi;
|
AccountsService, Atk, Clutter, Gdm, Gio,
|
||||||
|
GnomeDesktop, GLib, GObject, Meta, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
|
|
||||||
const Background = imports.ui.background;
|
const Background = imports.ui.background;
|
||||||
const Layout = imports.ui.layout;
|
const Layout = imports.ui.layout;
|
||||||
|
@ -111,12 +111,16 @@ class UserWidgetLabel extends St.Widget {
|
|||||||
|
|
||||||
this._user = user;
|
this._user = user;
|
||||||
|
|
||||||
this._realNameLabel = new St.Label({ style_class: 'user-widget-label',
|
this._realNameLabel = new St.Label({
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
style_class: 'user-widget-label',
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this.add_child(this._realNameLabel);
|
this.add_child(this._realNameLabel);
|
||||||
|
|
||||||
this._userNameLabel = new St.Label({ style_class: 'user-widget-label',
|
this._userNameLabel = new St.Label({
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
style_class: 'user-widget-label',
|
||||||
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this.add_child(this._userNameLabel);
|
this.add_child(this._userNameLabel);
|
||||||
|
|
||||||
this._currentLabel = null;
|
this._currentLabel = null;
|
||||||
|
@ -42,13 +42,15 @@ class WelcomeDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
this.contentLayout.add_child(content);
|
this.contentLayout.add_child(content);
|
||||||
|
|
||||||
this.addButton({ label: _('No Thanks'),
|
this.addButton({
|
||||||
action: () => {
|
label: _('No Thanks'),
|
||||||
this._sendResponse(DialogResponse.NO_THANKS);
|
action: () => this._sendResponse(DialogResponse.NO_THANKS),
|
||||||
},
|
key: Clutter.KEY_Escape,
|
||||||
key: Clutter.KEY_Escape });
|
});
|
||||||
this.addButton({ label: _('Take Tour'),
|
this.addButton({
|
||||||
action: () => this._sendResponse(DialogResponse.TAKE_TOUR) });
|
label: _('Take Tour'),
|
||||||
|
action: () => this._sendResponse(DialogResponse.TAKE_TOUR),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendResponse(response) {
|
_sendResponse(response) {
|
||||||
|
@ -68,12 +68,16 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog {
|
|||||||
/* Translators: this and the following message should be limited in length,
|
/* Translators: this and the following message should be limited in length,
|
||||||
to avoid ellipsizing the labels.
|
to avoid ellipsizing the labels.
|
||||||
*/
|
*/
|
||||||
this._cancelButton = this.addButton({ label: _("Revert Settings"),
|
this._cancelButton = this.addButton({
|
||||||
|
label: _('Revert Settings'),
|
||||||
action: this._onFailure.bind(this),
|
action: this._onFailure.bind(this),
|
||||||
key: Clutter.KEY_Escape });
|
key: Clutter.KEY_Escape,
|
||||||
this._okButton = this.addButton({ label: _("Keep Changes"),
|
});
|
||||||
|
this._okButton = this.addButton({
|
||||||
|
label: _('Keep Changes'),
|
||||||
action: this._onSuccess.bind(this),
|
action: this._onSuccess.bind(this),
|
||||||
default: true });
|
default: true,
|
||||||
|
});
|
||||||
|
|
||||||
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, ONE_SECOND, this._tick.bind(this));
|
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, ONE_SECOND, this._tick.bind(this));
|
||||||
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._tick');
|
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._tick');
|
||||||
@ -413,10 +417,12 @@ class TilePreview extends St.Widget {
|
|||||||
this._updateStyle(monitor);
|
this._updateStyle(monitor);
|
||||||
|
|
||||||
if (!this._showing || changeMonitor) {
|
if (!this._showing || changeMonitor) {
|
||||||
let monitorRect = new Meta.Rectangle({ x: monitor.x,
|
const monitorRect = new Meta.Rectangle({
|
||||||
|
x: monitor.x,
|
||||||
y: monitor.y,
|
y: monitor.y,
|
||||||
width: monitor.width,
|
width: monitor.width,
|
||||||
height: monitor.height });
|
height: monitor.height,
|
||||||
|
});
|
||||||
let [, rect] = window.get_frame_rect().intersect(monitorRect);
|
let [, rect] = window.get_frame_rect().intersect(monitorRect);
|
||||||
this.set_size(rect.width, rect.height);
|
this.set_size(rect.width, rect.height);
|
||||||
this.set_position(rect.x, rect.y);
|
this.set_position(rect.x, rect.y);
|
||||||
@ -533,10 +539,13 @@ var 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({ style_class: 'resize-popup',
|
this._label = new St.Label({
|
||||||
|
style_class: 'resize-popup',
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
x_expand: true, y_expand: true });
|
x_expand: true,
|
||||||
|
y_expand: true,
|
||||||
|
});
|
||||||
this.add_child(this._label);
|
this.add_child(this._label);
|
||||||
Main.uiGroup.add_actor(this);
|
Main.uiGroup.add_actor(this);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported WindowPreview */
|
/* exported WindowPreview */
|
||||||
|
|
||||||
const { Atk, Clutter, GLib, GObject,
|
const {
|
||||||
Graphene, Meta, Pango, Shell, St } = imports.gi;
|
Atk, Clutter, GLib, GObject, Graphene, Meta, Pango, Shell, St,
|
||||||
|
} = imports.gi;
|
||||||
|
|
||||||
const DND = imports.ui.dnd;
|
const DND = imports.ui.dnd;
|
||||||
const OverviewControls = imports.ui.overviewControls;
|
const OverviewControls = imports.ui.overviewControls;
|
||||||
@ -104,11 +105,12 @@ var WindowPreview = GObject.registerClass({
|
|||||||
this.add_action(clickAction);
|
this.add_action(clickAction);
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
|
|
||||||
this._draggable = DND.makeDraggable(this,
|
this._draggable = DND.makeDraggable(this, {
|
||||||
{ restoreOnSuccess: true,
|
restoreOnSuccess: true,
|
||||||
manualMode: true,
|
manualMode: true,
|
||||||
dragActorMaxSize: WINDOW_DND_SIZE,
|
dragActorMaxSize: WINDOW_DND_SIZE,
|
||||||
dragActorOpacity: DRAGGING_WINDOW_OPACITY });
|
dragActorOpacity: DRAGGING_WINDOW_OPACITY,
|
||||||
|
});
|
||||||
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));
|
||||||
this._draggable.connect('drag-end', this._onDragEnd.bind(this));
|
this._draggable.connect('drag-end', this._onDragEnd.bind(this));
|
||||||
|
@ -152,10 +152,12 @@ var UnalignedLayoutStrategy = class extends LayoutStrategy {
|
|||||||
// meant to be scaled
|
// meant to be scaled
|
||||||
//
|
//
|
||||||
// * neither height/fullHeight have any sort of spacing or padding
|
// * neither height/fullHeight have any sort of spacing or padding
|
||||||
return { x: 0, y: 0,
|
return {
|
||||||
|
x: 0, y: 0,
|
||||||
width: 0, height: 0,
|
width: 0, height: 0,
|
||||||
fullWidth: 0, fullHeight: 0,
|
fullWidth: 0, fullHeight: 0,
|
||||||
windows: [] };
|
windows: [],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Computes and returns an individual scaling factor for @window,
|
// Computes and returns an individual scaling factor for @window,
|
||||||
@ -1499,8 +1501,10 @@ class Workspace extends St.Widget {
|
|||||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||||
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
||||||
// extensions to define custom actions for their drag sources.
|
// extensions to define custom actions for their drag sources.
|
||||||
source.shellWorkspaceLaunch({ workspace: workspaceIndex,
|
source.shellWorkspaceLaunch({
|
||||||
timestamp: time });
|
workspace: workspaceIndex,
|
||||||
|
timestamp: time,
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,10 +76,11 @@ var WindowClone = GObject.registerClass({
|
|||||||
|
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
|
|
||||||
this._draggable = DND.makeDraggable(this,
|
this._draggable = DND.makeDraggable(this, {
|
||||||
{ restoreOnSuccess: true,
|
restoreOnSuccess: true,
|
||||||
dragActorMaxSize: Workspace.WINDOW_DND_SIZE,
|
dragActorMaxSize: Workspace.WINDOW_DND_SIZE,
|
||||||
dragActorOpacity: Workspace.DRAGGING_WINDOW_OPACITY });
|
dragActorOpacity: Workspace.DRAGGING_WINDOW_OPACITY,
|
||||||
|
});
|
||||||
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));
|
||||||
this._draggable.connect('drag-end', this._onDragEnd.bind(this));
|
this._draggable.connect('drag-end', this._onDragEnd.bind(this));
|
||||||
@ -593,8 +594,10 @@ var WorkspaceThumbnail = GObject.registerClass({
|
|||||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||||
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
||||||
// extensions to define custom actions for their drag sources.
|
// extensions to define custom actions for their drag sources.
|
||||||
source.shellWorkspaceLaunch({ workspace: this.metaWorkspace.index(),
|
source.shellWorkspaceLaunch({
|
||||||
timestamp: time });
|
workspace: this.metaWorkspace.index(),
|
||||||
|
timestamp: time,
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -964,8 +967,10 @@ var ThumbnailsBox = GObject.registerClass({
|
|||||||
} else if (!source.app && source.shellWorkspaceLaunch) {
|
} else if (!source.app && source.shellWorkspaceLaunch) {
|
||||||
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
// While unused in our own drag sources, shellWorkspaceLaunch allows
|
||||||
// extensions to define custom actions for their drag sources.
|
// extensions to define custom actions for their drag sources.
|
||||||
source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex,
|
source.shellWorkspaceLaunch({
|
||||||
timestamp: time });
|
workspace: newWorkspaceIndex,
|
||||||
|
timestamp: time,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source.app || (!source.app && source.shellWorkspaceLaunch)) {
|
if (source.app || (!source.app && source.shellWorkspaceLaunch)) {
|
||||||
|
@ -59,8 +59,10 @@ var XdndHandler = class {
|
|||||||
if (!cursorWindow.get_meta_window().is_override_redirect())
|
if (!cursorWindow.get_meta_window().is_override_redirect())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let constraintPosition = new Clutter.BindConstraint({ coordinate: Clutter.BindCoordinate.POSITION,
|
const constraintPosition = new Clutter.BindConstraint({
|
||||||
source: cursorWindow });
|
coordinate: Clutter.BindCoordinate.POSITION,
|
||||||
|
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);
|
||||||
|
@ -7,8 +7,6 @@ rules:
|
|||||||
- 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child'
|
- 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child'
|
||||||
CallExpression:
|
CallExpression:
|
||||||
arguments: first
|
arguments: first
|
||||||
ObjectExpression: first
|
|
||||||
MemberExpression: off
|
|
||||||
jsdoc/check-alignment: off
|
jsdoc/check-alignment: off
|
||||||
jsdoc/check-param-names: off
|
jsdoc/check-param-names: off
|
||||||
jsdoc/check-tag-names: off
|
jsdoc/check-tag-names: off
|
||||||
@ -20,7 +18,4 @@ 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-newline:
|
|
||||||
- error
|
|
||||||
- consistent: true
|
|
||||||
quotes: off
|
quotes: off
|
||||||
|
Loading…
Reference in New Issue
Block a user