Commit 90ad7956 authored by Medicean's avatar Medicean

Change(Window): 优化窗口关闭逻辑 #245

parent dc0210d5
...@@ -34,6 +34,11 @@ eg: ...@@ -34,6 +34,11 @@ eg:
> 能够适配所有编码器的Shell比较少, 这个功能就略显鸡肋, 我们决定移除它 > 能够适配所有编码器的Shell比较少, 这个功能就略显鸡肋, 我们决定移除它
### 其它
* 优化窗口关闭逻辑 #245
点击最小化时,不再最小化至系统托盘。点击关闭按钮,最小化至系统托盘。点击托盘菜单中的「退出」程序退出。
## 2021/02/06 `v(2.1.10)` ## 2021/02/06 `v(2.1.10)`
......
...@@ -71,9 +71,7 @@ app.once('ready', () => { ...@@ -71,9 +71,7 @@ app.once('ready', () => {
// 窗口事件监听 // 窗口事件监听
mainWindow.on('close', (event) => { mainWindow.on('close', (event) => {
event.preventDefault(); event.preventDefault();
app.exit(0); // app.exit(0);
}).on('minimize', (event) => {
event.preventDefault();
if (process.platform == 'darwin') { if (process.platform == 'darwin') {
app.hide(); app.hide();
} else if (process.platform == 'linux') { } else if (process.platform == 'linux') {
...@@ -81,6 +79,8 @@ app.once('ready', () => { ...@@ -81,6 +79,8 @@ app.once('ready', () => {
} else { } else {
mainWindow.hide(); mainWindow.hide();
} }
}).on('minimize', (event) => {
event.preventDefault();
}) })
.on('resize', reloadUI) .on('resize', reloadUI)
.on('maximize', reloadUI) .on('maximize', reloadUI)
......
...@@ -283,7 +283,7 @@ class Menubar { ...@@ -283,7 +283,7 @@ class Menubar {
label: LANG['tray']['quit'], label: LANG['tray']['quit'],
click: this click: this
.app .app
.quit .exit
.bind(this.app) .bind(this.app)
}]; }];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment