diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-11-03 11:46:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-03 11:46:06 +0100 |
commit | 6d6878c95732ba9db2be62b247da821295b1c053 (patch) | |
tree | cd6fa8956c722149e4a4e3b9eadbf024aff19144 | |
parent | Merge pull request #181 from meetfranz/feature/recipe-notification-api (diff) | |
parent | fix(Windows): Open Window when app is pinned to taskbar and minimized to syst... (diff) | |
download | ferdium-app-6d6878c95732ba9db2be62b247da821295b1c053.tar.gz ferdium-app-6d6878c95732ba9db2be62b247da821295b1c053.tar.zst ferdium-app-6d6878c95732ba9db2be62b247da821295b1c053.zip |
Merge pull request #205 from meetfranz/feature/win-window-restore
Open Window when app is pinned to taskbar and minimized to system tray
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/index.js | 13 |
2 files changed, 8 insertions, 6 deletions
diff --git a/package.json b/package.json index dcb05bf6a..56c02ddf2 100644 --- a/package.json +++ b/package.json | |||
@@ -32,7 +32,6 @@ | |||
32 | "classnames": "^2.2.5", | 32 | "classnames": "^2.2.5", |
33 | "electron-fetch": "^1.1.0", | 33 | "electron-fetch": "^1.1.0", |
34 | "electron-spellchecker": "^1.2.0", | 34 | "electron-spellchecker": "^1.2.0", |
35 | "electron-squirrel-startup": "^1.0.0", | ||
36 | "electron-updater": "^2.4.3", | 35 | "electron-updater": "^2.4.3", |
37 | "electron-window-state": "^4.1.0", | 36 | "electron-window-state": "^4.1.0", |
38 | "fs-extra": "^3.0.1", | 37 | "fs-extra": "^3.0.1", |
diff --git a/src/index.js b/src/index.js index 030736fee..a72d76f3a 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -2,18 +2,14 @@ import { app, BrowserWindow, shell } from 'electron'; | |||
2 | import fs from 'fs-extra'; | 2 | import fs from 'fs-extra'; |
3 | import path from 'path'; | 3 | import path from 'path'; |
4 | 4 | ||
5 | /* eslint-disable */ | ||
6 | if (require('electron-squirrel-startup')) app.quit(); | ||
7 | |||
8 | import windowStateKeeper from 'electron-window-state'; | 5 | import windowStateKeeper from 'electron-window-state'; |
9 | 6 | ||
10 | import { isDevMode, isWindows } from './environment'; | 7 | import { isDevMode, isWindows } from './environment'; |
11 | import ipcApi from './electron/ipc-api'; | 8 | import ipcApi from './electron/ipc-api'; |
12 | import Tray from './lib/Tray'; | 9 | import Tray from './lib/Tray'; |
13 | import Settings from './electron/Settings'; | 10 | import Settings from './electron/Settings'; |
14 | import { appId } from './package.json'; | 11 | import { appId } from './package.json'; // eslint-disable-line import/no-unresolved |
15 | import './electron/exception'; | 12 | import './electron/exception'; |
16 | /* eslint-enable */ | ||
17 | 13 | ||
18 | // Keep a global reference of the window object, if you don't, the window will | 14 | // Keep a global reference of the window object, if you don't, the window will |
19 | // be closed automatically when the JavaScript object is garbage collected. | 15 | // be closed automatically when the JavaScript object is garbage collected. |
@@ -114,6 +110,13 @@ const createWindow = async () => { | |||
114 | app.isMaximized = true; | 110 | app.isMaximized = true; |
115 | }); | 111 | }); |
116 | 112 | ||
113 | mainWindow.on('close', (e) => { | ||
114 | if (settings.get('minimizeToSystemTray')) { | ||
115 | e.preventDefault(); | ||
116 | mainWindow.minimize(); | ||
117 | } | ||
118 | }); | ||
119 | |||
117 | mainWindow.on('unmaximize', () => { | 120 | mainWindow.on('unmaximize', () => { |
118 | app.isMaximized = false; | 121 | app.isMaximized = false; |
119 | }); | 122 | }); |