1 Star 0 Fork 20

zhanghua/gnome-shell

forked from src-openEuler/gnome-shell 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
dogsheng 提交于 2019-12-14 18:54 . Package init
From 68b038ba1ee10cb957eec56fec435e3cfeffd20d 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
index 4804333d4..5657cbffd 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -437,25 +437,26 @@ var EndSessionDialog = new Lang.Class({
},
_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);
},
close(skipSignal) {
--
2.19.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhanghua1831/gnome-shell.git
git@gitee.com:zhanghua1831/gnome-shell.git
zhanghua1831
gnome-shell
gnome-shell
master

搜索帮助