Finished: miniwindow

This commit is contained in:
Molunerfinn
2018-07-06 23:54:36 +08:00
parent abcd7b848d
commit 4d5b3fbdf6
4 changed files with 92 additions and 7 deletions

View File

@@ -75,7 +75,6 @@ function createTray () {
} else {
settingWindow.show()
settingWindow.focus()
miniWindow.show()
}
}
},
@@ -196,10 +195,13 @@ const createWindow = () => {
}
const createMiniWidow = () => {
if (miniWindow) {
return false
}
miniWindow = new BrowserWindow({
height: 64,
width: 64, // 196
show: true,
width: 64,
show: false,
frame: false,
fullscreenable: false,
resizable: false,
@@ -432,6 +434,23 @@ ipcMain.on('autoStart', (evt, val) => {
})
})
ipcMain.on('openSettingWindow', (evt) => {
if (!settingWindow) {
createSettingWindow()
} else {
settingWindow.show()
}
miniWindow.hide()
})
ipcMain.on('openMiniWindow', (evt) => {
if (!miniWindow) {
createMiniWidow()
}
miniWindow.show()
settingWindow.hide()
})
const shortKeyHash = {
upload: uploadClipboardFiles
}