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

53 lines
1.8 KiB
Diff
Raw Normal View History

2020-02-06 21:04:21 +00:00
From c907dbe205257d29ca74d9e30cf2e100d85f277b 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.
---
2019-10-09 01:53:25 +00:00
js/ui/endSessionDialog.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
2020-02-06 21:04:21 +00:00
index ff1aa0ddf..27ddf6804 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
2020-02-06 21:04:21 +00:00
@@ -369,15 +369,17 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
2019-02-07 01:50:26 +00:00
}
_updateButtons() {
- let dialogContent = DialogContent[this._type];
- let buttons = [{ action: this.cancel.bind(this),
+ this.clearButtons();
+
+ this.addButton({ action: this.cancel.bind(this),
label: _("Cancel"),
2019-12-11 22:39:28 +00:00
- key: Clutter.KEY_Escape }];
+ key: Clutter.KEY_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;
2019-10-09 01:53:25 +00:00
- buttons.push({
2019-08-09 22:56:47 +00:00
+ let button = this.addButton({
2019-10-09 01:53:25 +00:00
action: () => {
this.close(true);
let signalId = this.connect('closed', () => {
2020-02-06 21:04:21 +00:00
@@ -388,8 +390,6 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
2019-12-11 22:39:28 +00:00
label,
2019-10-09 01:53:25 +00:00
});
}
-
- this.setButtons(buttons);
2019-02-07 01:50:26 +00:00
}
close(skipSignal) {
--
2020-02-06 21:04:21 +00:00
2.24.1