inhibitShortcutsDialog: Adapt to new dialog design
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/962
This commit is contained in:
parent
2996d9d977
commit
d5dbc28f77
@ -240,11 +240,6 @@
|
|||||||
spacing: 30px;
|
spacing: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inhibit-Shortcuts Dialog */
|
|
||||||
.inhibit-shortcuts-dialog {
|
|
||||||
spacing: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Network Agent Dialog */
|
/* Network Agent Dialog */
|
||||||
|
|
||||||
.network-dialog-secret-table {
|
.network-dialog-secret-table {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* exported InhibitShortcutsDialog */
|
/* exported InhibitShortcutsDialog */
|
||||||
const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell } = imports.gi;
|
const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St } = imports.gi;
|
||||||
|
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
const ModalDialog = imports.ui.modalDialog;
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
@ -75,22 +75,25 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
|||||||
_buildLayout() {
|
_buildLayout() {
|
||||||
let name = this._app ? this._app.get_name() : this._window.title;
|
let name = this._app ? this._app.get_name() : this._window.title;
|
||||||
|
|
||||||
/* Translators: %s is an application name like "Settings" */
|
let content = new Dialog.MessageDialogContent({
|
||||||
let title = name
|
title: _('Allow inhibiting shortcuts'),
|
||||||
? _("%s wants to inhibit shortcuts").format(name)
|
description: name
|
||||||
: _("Application wants to inhibit shortcuts");
|
/* Translators: %s is an application name like "Settings" */
|
||||||
|
? _('The application %s wants to inhibit shortcuts').format(name)
|
||||||
let contentParams = { title };
|
: _('An application wants to inhibit shortcuts'),
|
||||||
|
});
|
||||||
|
|
||||||
let restoreAccel = this._getRestoreAccel();
|
let restoreAccel = this._getRestoreAccel();
|
||||||
if (restoreAccel) {
|
if (restoreAccel) {
|
||||||
contentParams.description =
|
let restoreLabel = new St.Label({
|
||||||
/* Translators: %s is a keyboard shortcut like "Super+x" */
|
/* Translators: %s is a keyboard shortcut like "Super+x" */
|
||||||
_("You can restore shortcuts by pressing %s.").format(restoreAccel);
|
text: _('You can restore shortcuts by pressing %s.').format(restoreAccel),
|
||||||
|
style_class: 'message-dialog-description',
|
||||||
|
});
|
||||||
|
content.add_child(restoreLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
let content = new Dialog.MessageDialogContent(contentParams);
|
this._dialog.contentLayout.add_child(content);
|
||||||
this._dialog.contentLayout.add_actor(content);
|
|
||||||
|
|
||||||
this._dialog.addButton({ label: _("Deny"),
|
this._dialog.addButton({ label: _("Deny"),
|
||||||
action: () => {
|
action: () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user