js: Move dialog parts out of messageBox
Since MessageDialogContent.messageBox is going to be removed in a subsequent commit, move the parts where it's used out of messageBox and into the contentLayout instead. This will introduce wrong spacings in some dialogs, which we're going to fix when implementing the redesigned individual dialogs. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
This commit is contained in:
parent
914c6e48b1
commit
929c2c3921
@ -154,7 +154,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._controlTable = table;
|
this._controlTable = table;
|
||||||
this._content.messageBox.add_child(table);
|
this._content.add_child(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateSensitivity(sensitive) {
|
_updateSensitivity(sensitive) {
|
||||||
|
@ -109,7 +109,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||||||
layout.attach(this._capsLockWarningLabel, 1, pos, 1, 1);
|
layout.attach(this._capsLockWarningLabel, 1, pos, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
contentBox.messageBox.add(secretTable);
|
contentBox.add_child(secretTable);
|
||||||
|
|
||||||
if (flags & NM.SecretAgentGetSecretsFlags.WPS_PBC_ACTIVE) {
|
if (flags & NM.SecretAgentGetSecretsFlags.WPS_PBC_ACTIVE) {
|
||||||
let descriptionLabel = new St.Label({ style_class: 'prompt-dialog-description',
|
let descriptionLabel = new St.Label({ style_class: 'prompt-dialog-description',
|
||||||
@ -117,7 +117,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||||||
descriptionLabel.clutter_text.line_wrap = true;
|
descriptionLabel.clutter_text.line_wrap = true;
|
||||||
descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
|
|
||||||
contentBox.messageBox.add_child(descriptionLabel);
|
contentBox.add_child(descriptionLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._okButton = {
|
this._okButton = {
|
||||||
|
@ -62,7 +62,7 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
style_class: 'polkit-dialog-user-layout',
|
style_class: 'polkit-dialog-user-layout',
|
||||||
vertical: false,
|
vertical: false,
|
||||||
});
|
});
|
||||||
content.messageBox.add(userBox);
|
content.add_child(userBox);
|
||||||
|
|
||||||
this._userAvatar = new UserWidget.Avatar(this._user, {
|
this._userAvatar = new UserWidget.Avatar(this._user, {
|
||||||
iconSize: DIALOG_ICON_SIZE,
|
iconSize: DIALOG_ICON_SIZE,
|
||||||
@ -84,7 +84,7 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
userBox.add_child(this._userLabel);
|
userBox.add_child(this._userLabel);
|
||||||
|
|
||||||
this._passwordBox = new St.BoxLayout({ vertical: false, style_class: 'prompt-dialog-password-box' });
|
this._passwordBox = new St.BoxLayout({ vertical: false, style_class: 'prompt-dialog-password-box' });
|
||||||
content.messageBox.add(this._passwordBox);
|
content.add_child(this._passwordBox);
|
||||||
this._passwordLabel = new St.Label({
|
this._passwordLabel = new St.Label({
|
||||||
style_class: 'prompt-dialog-password-label',
|
style_class: 'prompt-dialog-password-label',
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
@ -110,18 +110,18 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
|
|
||||||
this._passwordBox.hide();
|
this._passwordBox.hide();
|
||||||
this._capsLockWarningLabel = new ShellEntry.CapsLockWarning({ style_class: 'prompt-dialog-caps-lock-warning' });
|
this._capsLockWarningLabel = new ShellEntry.CapsLockWarning({ style_class: 'prompt-dialog-caps-lock-warning' });
|
||||||
content.messageBox.add(this._capsLockWarningLabel);
|
content.add_child(this._capsLockWarningLabel);
|
||||||
|
|
||||||
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' });
|
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' });
|
||||||
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._errorMessageLabel.clutter_text.line_wrap = true;
|
this._errorMessageLabel.clutter_text.line_wrap = true;
|
||||||
content.messageBox.add_child(this._errorMessageLabel);
|
content.add_child(this._errorMessageLabel);
|
||||||
this._errorMessageLabel.hide();
|
this._errorMessageLabel.hide();
|
||||||
|
|
||||||
this._infoMessageLabel = new St.Label({ style_class: 'prompt-dialog-info-label' });
|
this._infoMessageLabel = new St.Label({ style_class: 'prompt-dialog-info-label' });
|
||||||
this._infoMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._infoMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._infoMessageLabel.clutter_text.line_wrap = true;
|
this._infoMessageLabel.clutter_text.line_wrap = true;
|
||||||
content.messageBox.add(this._infoMessageLabel);
|
content.add_child(this._infoMessageLabel);
|
||||||
this._infoMessageLabel.hide();
|
this._infoMessageLabel.hide();
|
||||||
|
|
||||||
/* text is intentionally non-blank otherwise the height is not the same as for
|
/* text is intentionally non-blank otherwise the height is not the same as for
|
||||||
@ -133,7 +133,7 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
this._nullMessageLabel.add_style_class_name('hidden');
|
this._nullMessageLabel.add_style_class_name('hidden');
|
||||||
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._nullMessageLabel.clutter_text.line_wrap = true;
|
this._nullMessageLabel.clutter_text.line_wrap = true;
|
||||||
content.messageBox.add(this._nullMessageLabel);
|
content.add_child(this._nullMessageLabel);
|
||||||
this._nullMessageLabel.show();
|
this._nullMessageLabel.show();
|
||||||
|
|
||||||
this._cancelButton = this.addButton({ label: _("Cancel"),
|
this._cancelButton = this.addButton({ label: _("Cancel"),
|
||||||
|
@ -306,14 +306,14 @@ var ShellMountPasswordDialog = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
this._hiddenVolume = new CheckBox.CheckBox(_("Hidden Volume"));
|
this._hiddenVolume = new CheckBox.CheckBox(_("Hidden Volume"));
|
||||||
content.messageBox.add(this._hiddenVolume);
|
content.add_child(this._hiddenVolume);
|
||||||
|
|
||||||
this._systemVolume = new CheckBox.CheckBox(_("Windows System Volume"));
|
this._systemVolume = new CheckBox.CheckBox(_("Windows System Volume"));
|
||||||
content.messageBox.add(this._systemVolume);
|
content.add_child(this._systemVolume);
|
||||||
|
|
||||||
this._keyfilesCheckbox = new CheckBox.CheckBox(_("Uses Keyfiles"));
|
this._keyfilesCheckbox = new CheckBox.CheckBox(_("Uses Keyfiles"));
|
||||||
this._keyfilesCheckbox.connect("clicked", this._onKeyfilesCheckboxClicked.bind(this));
|
this._keyfilesCheckbox.connect("clicked", this._onKeyfilesCheckboxClicked.bind(this));
|
||||||
content.messageBox.add(this._keyfilesCheckbox);
|
content.add_child(this._keyfilesCheckbox);
|
||||||
|
|
||||||
this._keyfilesLabel.clutter_text.set_markup(
|
this._keyfilesLabel.clutter_text.set_markup(
|
||||||
/* Translators: %s is the Disks application */
|
/* Translators: %s is the Disks application */
|
||||||
@ -321,7 +321,7 @@ var ShellMountPasswordDialog = GObject.registerClass({
|
|||||||
);
|
);
|
||||||
this._keyfilesLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._keyfilesLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._keyfilesLabel.clutter_text.line_wrap = true;
|
this._keyfilesLabel.clutter_text.line_wrap = true;
|
||||||
content.messageBox.add_child(this._keyfilesLabel);
|
content.add_child(this._keyfilesLabel);
|
||||||
|
|
||||||
this._pimLabel = new St.Label({ style_class: 'prompt-dialog-password-label',
|
this._pimLabel = new St.Label({ style_class: 'prompt-dialog-password-label',
|
||||||
text: _("PIM Number"),
|
text: _("PIM Number"),
|
||||||
@ -380,20 +380,20 @@ var ShellMountPasswordDialog = GObject.registerClass({
|
|||||||
layout.attach(this._capsLockWarningLabel, 1, 2, 1, 1);
|
layout.attach(this._capsLockWarningLabel, 1, 2, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
content.messageBox.add(grid);
|
content.add_child(grid);
|
||||||
|
|
||||||
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label',
|
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label',
|
||||||
text: _("Sorry, that didn’t work. Please try again.") });
|
text: _("Sorry, that didn’t work. Please try again.") });
|
||||||
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._errorMessageLabel.clutter_text.line_wrap = true;
|
this._errorMessageLabel.clutter_text.line_wrap = true;
|
||||||
this._errorMessageLabel.hide();
|
this._errorMessageLabel.hide();
|
||||||
content.messageBox.add(this._errorMessageLabel);
|
content.add_child(this._errorMessageLabel);
|
||||||
|
|
||||||
if (flags & Gio.AskPasswordFlags.SAVING_SUPPORTED) {
|
if (flags & Gio.AskPasswordFlags.SAVING_SUPPORTED) {
|
||||||
this._rememberChoice = new CheckBox.CheckBox(_("Remember Password"));
|
this._rememberChoice = new CheckBox.CheckBox(_("Remember Password"));
|
||||||
this._rememberChoice.checked =
|
this._rememberChoice.checked =
|
||||||
global.settings.get_boolean(REMEMBER_MOUNT_PASSWORD_KEY);
|
global.settings.get_boolean(REMEMBER_MOUNT_PASSWORD_KEY);
|
||||||
content.messageBox.add(this._rememberChoice);
|
content.add_child(this._rememberChoice);
|
||||||
} else {
|
} else {
|
||||||
this._rememberChoice = null;
|
this._rememberChoice = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user