2.3 released

This commit is contained in:
life
2017-01-22 22:41:16 +08:00
parent 405d6c6330
commit 414a562563
8 changed files with 126 additions and 74 deletions

23
main.js
View File

@@ -116,7 +116,19 @@ function removeEvents (win) {
win.removeAllListeners('close');
}
function close (e, force) {
console.log('close:', force);
if (mainWindow) {
mainWindow.hide();
e && e.preventDefault();
mainWindow.webContents.send('closeWindow');
} else {
app.quit();
}
}
function bindEvents (win) {
mainWindow = win;
// Emitted when the window is closed.
win.on('closed', function() {
@@ -138,17 +150,6 @@ function bindEvents (win) {
if(win && win.webContents)
win.webContents.send('blurWindow');
});
function close (e, force) {
console.log('close:', force);
if (win) {
win.hide();
e && e.preventDefault();
win.webContents.send('closeWindow');
} else {
app.quit();
}
}
// 以前的关闭是真关闭, 现是是假关闭了
// 关闭,先保存数据