Commit 769d7164 authored by 神楽坂玲奈's avatar 神楽坂玲奈

tray

parent 8b56b547
......@@ -163,6 +163,7 @@ function createWindow() {
}
function createTray() {
console.log('create tray begin');
let tray = new Tray(path.join(process.env['NODE_ENV'] == 'production' ? process.resourcesPath : app.getAppPath(), 'images', 'icon.ico'));
tray.on('click', (event) => {
mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show();
......@@ -176,20 +177,24 @@ function createTray() {
}
]);
tray.setToolTip('MyCard');
tray.setContextMenu(contextMenu)
tray.setContextMenu(contextMenu);
console.log('create tray finish');
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
console.log('create window');
createWindow();
if (process.env['NODE_ENV'] == 'production') {
autoUpdater.checkForUpdates()
}
if (process.platform == 'win32') {
console.log('before create tray');
createTray()
}
if (process.env['NODE_ENV'] == 'production') {
autoUpdater.checkForUpdates()
}
console.log('update');
});
// Quit when all windows are closed.
......
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