dialog: Remove MessageDialogContent.body property

According to the new dialog design, dialogs generally only have a title
and a description, so the `body` property is no longer needed.

At the places where it's still used, we replace it with the description
property or a plain label we add to MessageDialogContent ourselves.

See https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
This commit is contained in:
Jonas Dreßler
2020-01-13 14:04:40 +01:00
committed by Florian Müllner
parent 845c52797b
commit 2fc84e0fe3
10 changed files with 41 additions and 61 deletions

View File

@ -1,5 +1,5 @@
/* exported AccessDialogDBus */
const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
const CheckBox = imports.ui.checkBox;
const Dialog = imports.ui.dialog;
@ -40,8 +40,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
let grantLabel = options['grant_label'] || _("Grant Access");
let choices = options['choices'] || [];
let contentParams = { title, description, body };
let content = new Dialog.MessageDialogContent(contentParams);
let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
this._choices = new Map();
@ -54,11 +53,17 @@ class AccessDialog extends ModalDialog.ModalDialog {
let check = new CheckBox.CheckBox();
check.getLabelActor().text = name;
check.checked = selected == "true";
content.insertBeforeBody(check);
content.add_child(check);
this._choices.set(id, check);
}
let bodyLabel = new St.Label({
text: body,
x_align: Clutter.ActorAlign.CENTER,
});
content.add_child(bodyLabel);
this.addButton({ label: denyLabel,
action: () => {
this._sendResponse(DialogResponse.CANCEL);