From 845c52797b4ec6890a2fab804903b11318139680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Mon, 13 Jan 2020 14:07:28 +0100 Subject: [PATCH] dialog: Rename subtitle property to description https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886 --- .../gnome-shell-sass/widgets/_dialogs.scss | 2 +- js/ui/accessDialog.js | 14 ++++++------- js/ui/closeDialog.js | 6 +++--- js/ui/dialog.js | 20 +++++++++---------- js/ui/inhibitShortcutsDialog.js | 2 +- js/ui/status/location.js | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/data/theme/gnome-shell-sass/widgets/_dialogs.scss b/data/theme/gnome-shell-sass/widgets/_dialogs.scss index dc846369f..2697e07b1 100644 --- a/data/theme/gnome-shell-sass/widgets/_dialogs.scss +++ b/data/theme/gnome-shell-sass/widgets/_dialogs.scss @@ -43,7 +43,7 @@ font-weight: bold; } -.message-dialog-subtitle { +.message-dialog-description { color: $fg_color; font-weight: bold; } diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js index 4f9f47202..e0fc8a179 100644 --- a/js/ui/accessDialog.js +++ b/js/ui/accessDialog.js @@ -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)); diff --git a/js/ui/closeDialog.js b/js/ui/closeDialog.js index b48428d20..4ee6de6d2 100644 --- a/js/ui/closeDialog.js +++ b/js/ui/closeDialog.js @@ -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() { diff --git a/js/ui/dialog.js b/js/ui/dialog.js index cce00c846..f8fca5655 100644 --- a/js/ui/dialog.js +++ b/js/ui/dialog.js @@ -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) { diff --git a/js/ui/inhibitShortcutsDialog.js b/js/ui/inhibitShortcutsDialog.js index 42cfb0f90..2ef2d04ed 100644 --- a/js/ui/inhibitShortcutsDialog.js +++ b/js/ui/inhibitShortcutsDialog.js @@ -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); } diff --git a/js/ui/status/location.js b/js/ui/status/location.js index 3ed54fe0e..e9754bc5b 100644 --- a/js/ui/status/location.js +++ b/js/ui/status/location.js @@ -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);