location: Adapt geolocation dialog to new design

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/962
This commit is contained in:
Jonas Dreßler 2020-01-27 22:38:49 +01:00 committed by Florian Müllner
parent eec25367fc
commit 2996d9d977
2 changed files with 14 additions and 11 deletions

View File

@ -240,11 +240,6 @@
spacing: 30px; spacing: 30px;
} }
/* Geolocation Dialog */
.geolocation-dialog {
spacing: 30px;
}
/* Inhibit-Shortcuts Dialog */ /* Inhibit-Shortcuts Dialog */
.inhibit-shortcuts-dialog { .inhibit-shortcuts-dialog {
spacing: 30px; spacing: 30px;

View File

@ -347,22 +347,30 @@ var AppAuthorizer = class {
var GeolocationDialog = GObject.registerClass({ var GeolocationDialog = GObject.registerClass({
Signals: { 'response': { param_types: [GObject.TYPE_UINT] } }, Signals: { 'response': { param_types: [GObject.TYPE_UINT] } },
}, class GeolocationDialog extends ModalDialog.ModalDialog { }, class GeolocationDialog extends ModalDialog.ModalDialog {
_init(name, description, reqAccuracyLevel) { _init(name, reason, reqAccuracyLevel) {
super._init({ styleClass: 'geolocation-dialog' }); super._init({ styleClass: 'geolocation-dialog' });
this.reqAccuracyLevel = reqAccuracyLevel; this.reqAccuracyLevel = reqAccuracyLevel;
/* Translators: %s is an application name */ let content = new Dialog.MessageDialogContent({
let title = _("Give %s access to your location?").format(name); title: _('Allow location access'),
/* Translators: %s is an application name */
description: _('The app %s wants to access your location').format(name),
});
let content = new Dialog.MessageDialogContent({ title, description }); let reasonLabel = new St.Label({
this.contentLayout.add_actor(content); text: reason,
style_class: 'message-dialog-description',
});
content.add_child(reasonLabel);
let infoLabel = new St.Label({ let infoLabel = new St.Label({
text: _('Location access can be changed at any time from the privacy settings.'), text: _('Location access can be changed at any time from the privacy settings.'),
x_align: Clutter.ActorAlign.CENTER, style_class: 'message-dialog-description',
}); });
content.add_child(infoLabel); content.add_child(infoLabel);
this.contentLayout.add_child(content);
let button = this.addButton({ label: _("Deny Access"), let button = this.addButton({ label: _("Deny Access"),
action: this._onDenyClicked.bind(this), action: this._onDenyClicked.bind(this),
key: Clutter.KEY_Escape }); key: Clutter.KEY_Escape });