gnome-shell/0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch

57 lines
2.1 KiB
Diff
Raw Normal View History

2019-02-07 01:50:26 +00:00
From ec93430e77cd572cfd313a399128744d9b05e7b9 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 15 Aug 2018 14:26:19 +0200
Subject: [PATCH 1/2] endSessionDialog: Immediately add buttons to the dialog
Immediately add buttons to the dialog instead of first building an
array of button-info structs.
This is a preparation patch for adding support changing the "Reboot"
button into a "Boot Options" button when Alt is pressed.
---
js/ui/endSessionDialog.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
2019-02-07 01:50:26 +00:00
index 1d6efc5ec..d107c87d9 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
2019-02-07 01:50:26 +00:00
@@ -432,25 +432,26 @@ var EndSessionDialog = class EndSessionDialog extends ModalDialog.ModalDialog {
}
_updateButtons() {
- let dialogContent = DialogContent[this._type];
- let buttons = [{ action: this.cancel.bind(this),
+ this.clearButtons();
+
+ this.addButton({ action: this.cancel.bind(this),
label: _("Cancel"),
- key: Clutter.Escape }];
+ key: Clutter.Escape });
+ let dialogContent = DialogContent[this._type];
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
let signal = dialogContent.confirmButtons[i].signal;
let label = dialogContent.confirmButtons[i].label;
- buttons.push({ action: () => {
+ let button = this.addButton(
+ { action: () => {
this.close(true);
let signalId = this.connect('closed', () => {
this.disconnect(signalId);
this._confirm(signal);
});
- },
- label: label });
+ },
+ label: label });
}
-
- this.setButtons(buttons);
2019-02-07 01:50:26 +00:00
}
close(skipSignal) {
--
2019-02-07 01:50:26 +00:00
2.20.1