dialog: Rename subtitle property to description
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
This commit is contained in:
parent
48f1c4b9d7
commit
845c52797b
@ -43,7 +43,7 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.message-dialog-subtitle {
|
||||
.message-dialog-description {
|
||||
color: $fg_color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ var DialogResponse = {
|
||||
|
||||
var AccessDialog = GObject.registerClass(
|
||||
class AccessDialog extends ModalDialog.ModalDialog {
|
||||
_init(invocation, handle, title, subtitle, body, options) {
|
||||
_init(invocation, handle, title, description, body, options) {
|
||||
super._init({ styleClass: 'access-dialog' });
|
||||
|
||||
this._invocation = invocation;
|
||||
@ -30,17 +30,17 @@ class AccessDialog extends ModalDialog.ModalDialog {
|
||||
for (let option in options)
|
||||
options[option] = options[option].deep_unpack();
|
||||
|
||||
this._buildLayout(title, subtitle, body, options);
|
||||
this._buildLayout(title, description, body, options);
|
||||
}
|
||||
|
||||
_buildLayout(title, subtitle, body, options) {
|
||||
_buildLayout(title, description, body, options) {
|
||||
// No support for non-modal system dialogs, so ignore the option
|
||||
// let modal = options['modal'] || true;
|
||||
let denyLabel = options['deny_label'] || _("Deny Access");
|
||||
let grantLabel = options['grant_label'] || _("Grant Access");
|
||||
let choices = options['choices'] || [];
|
||||
|
||||
let contentParams = { title, subtitle, body };
|
||||
let contentParams = { title, description, body };
|
||||
let content = new Dialog.MessageDialogContent(contentParams);
|
||||
this.contentLayout.add_actor(content);
|
||||
|
||||
@ -130,7 +130,7 @@ var AccessDialogDBus = class {
|
||||
return;
|
||||
}
|
||||
|
||||
let [handle, appId, parentWindow_, title, subtitle, body, options] = params;
|
||||
let [handle, appId, parentWindow_, title, description, body, options] = params;
|
||||
// We probably want to use parentWindow and global.display.focus_window
|
||||
// for this check in the future
|
||||
if (appId && `${appId}.desktop` != this._windowTracker.focus_app.id) {
|
||||
@ -140,8 +140,8 @@ var AccessDialogDBus = class {
|
||||
return;
|
||||
}
|
||||
|
||||
let dialog = new AccessDialog(invocation, handle, title,
|
||||
subtitle, body, options);
|
||||
let dialog = new AccessDialog(
|
||||
invocation, handle, title, description, body, options);
|
||||
dialog.open();
|
||||
|
||||
dialog.connect('closed', () => (this._accessDialog = null));
|
||||
|
@ -40,9 +40,9 @@ var CloseDialog = GObject.registerClass({
|
||||
|
||||
/* Translators: %s is an application name */
|
||||
let title = _("“%s” is not responding.").format(windowApp.get_name());
|
||||
let subtitle = _("You may choose to wait a short while for it to " +
|
||||
"continue or force the application to quit entirely.");
|
||||
return new Dialog.MessageDialogContent({ title, subtitle });
|
||||
let description = _('You may choose to wait a short while for it to ' +
|
||||
'continue or force the application to quit entirely.');
|
||||
return new Dialog.MessageDialogContent({ title, description });
|
||||
}
|
||||
|
||||
_updateScale() {
|
||||
|
@ -151,8 +151,8 @@ var MessageDialogContent = GObject.registerClass({
|
||||
GObject.ParamFlags.READWRITE |
|
||||
GObject.ParamFlags.CONSTRUCT,
|
||||
null),
|
||||
'subtitle': GObject.ParamSpec.string(
|
||||
'subtitle', 'subtitle', 'subtitle',
|
||||
'description': GObject.ParamSpec.string(
|
||||
'description', 'description', 'description',
|
||||
GObject.ParamFlags.READWRITE |
|
||||
GObject.ParamFlags.CONSTRUCT,
|
||||
null),
|
||||
@ -165,10 +165,10 @@ var MessageDialogContent = GObject.registerClass({
|
||||
}, class MessageDialogContent extends St.BoxLayout {
|
||||
_init(params) {
|
||||
this._title = new St.Label();
|
||||
this._subtitle = new St.Label();
|
||||
this._description = new St.Label();
|
||||
this._body = new St.Label();
|
||||
|
||||
['title', 'subtitle', 'body'].forEach(prop => {
|
||||
['title', 'description', 'body'].forEach(prop => {
|
||||
this[`_${prop}`].add_style_class_name(`message-dialog-${prop}`);
|
||||
});
|
||||
|
||||
@ -176,7 +176,7 @@ var MessageDialogContent = GObject.registerClass({
|
||||
ellipsize: Pango.EllipsizeMode.NONE,
|
||||
line_wrap: true,
|
||||
};
|
||||
this._subtitle.clutter_text.set(textProps);
|
||||
this._description.clutter_text.set(textProps);
|
||||
this._body.clutter_text.set(textProps);
|
||||
|
||||
let defaultParams = {
|
||||
@ -187,7 +187,7 @@ var MessageDialogContent = GObject.registerClass({
|
||||
super._init(Object.assign(defaultParams, params));
|
||||
|
||||
this.add_child(this._title);
|
||||
this.add_child(this._subtitle);
|
||||
this.add_child(this._description);
|
||||
this.add_child(this._body);
|
||||
}
|
||||
|
||||
@ -195,8 +195,8 @@ var MessageDialogContent = GObject.registerClass({
|
||||
return this._title.text;
|
||||
}
|
||||
|
||||
get subtitle() {
|
||||
return this._subtitle.text;
|
||||
get description() {
|
||||
return this._description.text;
|
||||
}
|
||||
|
||||
get body() {
|
||||
@ -207,8 +207,8 @@ var MessageDialogContent = GObject.registerClass({
|
||||
this._setLabel(this._title, 'title', title);
|
||||
}
|
||||
|
||||
set subtitle(subtitle) {
|
||||
this._setLabel(this._subtitle, 'subtitle', subtitle);
|
||||
set description(description) {
|
||||
this._setLabel(this._description, 'description', description);
|
||||
}
|
||||
|
||||
set body(body) {
|
||||
|
@ -84,7 +84,7 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
||||
|
||||
let restoreAccel = this._getRestoreAccel();
|
||||
if (restoreAccel) {
|
||||
contentParams.subtitle =
|
||||
contentParams.description =
|
||||
/* Translators: %s is a keyboard shortcut like "Super+x" */
|
||||
_("You can restore shortcuts by pressing %s.").format(restoreAccel);
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ var AppAuthorizer = class {
|
||||
var GeolocationDialog = GObject.registerClass({
|
||||
Signals: { 'response': { param_types: [GObject.TYPE_UINT] } },
|
||||
}, class GeolocationDialog extends ModalDialog.ModalDialog {
|
||||
_init(name, subtitle, reqAccuracyLevel) {
|
||||
_init(name, description, reqAccuracyLevel) {
|
||||
super._init({ styleClass: 'geolocation-dialog' });
|
||||
this.reqAccuracyLevel = reqAccuracyLevel;
|
||||
|
||||
@ -355,7 +355,7 @@ var GeolocationDialog = GObject.registerClass({
|
||||
let title = _("Give %s access to your location?").format(name);
|
||||
let body = _("Location access can be changed at any time from the privacy settings.");
|
||||
|
||||
let contentParams = { title, subtitle, body };
|
||||
let contentParams = { title, description, body };
|
||||
let content = new Dialog.MessageDialogContent(contentParams);
|
||||
this.contentLayout.add_actor(content);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user