diff options
author | 2017-10-19 02:18:32 +0200 | |
---|---|---|
committer | 2017-10-19 02:18:32 +0200 | |
commit | 8313fb48c5f2efd1cd6742056ac397af50ee326b (patch) | |
tree | f251d06058b0a1b3bc607c4e1b93538eebf491ba /src/electron/ipc-api/tray.js | |
parent | Merge pull request #5 from GustavoKatel/master (diff) | |
download | ferdium-app-8313fb48c5f2efd1cd6742056ac397af50ee326b.tar.gz ferdium-app-8313fb48c5f2efd1cd6742056ac397af50ee326b.tar.zst ferdium-app-8313fb48c5f2efd1cd6742056ac397af50ee326b.zip |
remove unused file
Diffstat (limited to 'src/electron/ipc-api/tray.js')
-rw-r--r-- | src/electron/ipc-api/tray.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/electron/ipc-api/tray.js b/src/electron/ipc-api/tray.js deleted file mode 100644 index 43364c0ed..000000000 --- a/src/electron/ipc-api/tray.js +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | import { Tray, Menu, ipcMain } from 'electron'; | ||
2 | import path from 'path'; | ||
3 | |||
4 | const INDICATOR_PLAIN = 'franz-taskbar'; | ||
5 | const INDICATOR_UNREAD = 'franz-taskbar-unread'; | ||
6 | |||
7 | const FILE_EXTENSION = process.platform === 'win32' ? 'ico' : 'png'; | ||
8 | |||
9 | let trayIcon; | ||
10 | |||
11 | function getAsset(asset) { | ||
12 | return path.join( | ||
13 | __dirname, '..', '..', 'assets', 'images', 'tray', process.platform, `${asset}.${FILE_EXTENSION}`, | ||
14 | ); | ||
15 | } | ||
16 | |||
17 | export default (params) => { | ||
18 | // if (process.platform === 'win32' || process.platform === 'linux') { | ||
19 | trayIcon = new Tray(getAsset(INDICATOR_PLAIN)); | ||
20 | const trayMenuTemplate = [ | ||
21 | { | ||
22 | label: 'Show Franz', | ||
23 | click() { | ||
24 | params.mainWindow.show(); | ||
25 | }, | ||
26 | }, { | ||
27 | label: 'Quit Franz', | ||
28 | click() { | ||
29 | params.app.quit(); | ||
30 | }, | ||
31 | }, | ||
32 | ]; | ||
33 | |||
34 | const trayMenu = Menu.buildFromTemplate(trayMenuTemplate); | ||
35 | trayIcon.setContextMenu(trayMenu); | ||
36 | |||
37 | trayIcon.on('click', () => { | ||
38 | params.mainWindow.show(); | ||
39 | }); | ||
40 | |||
41 | ipcMain.on('updateTrayIconIndicator', (event, args) => { | ||
42 | trayIcon.setImage(getAsset(args.count !== 0 ? INDICATOR_UNREAD : INDICATOR_PLAIN)); | ||
43 | |||
44 | if (process.platform === 'darwin') { | ||
45 | trayIcon.setPressedImage(getAsset(`${args.count !== 0 ? INDICATOR_UNREAD : INDICATOR_PLAIN}-active`)); | ||
46 | } | ||
47 | }); | ||
48 | }; | ||