|
1 | 1 | const {app, BrowserWindow, Tray, Menu} = require('electron');
|
2 | 2 | const url = require('url');
|
3 | 3 | const notifier = require('node-notifier');
|
| 4 | +const path = require("path"); |
4 | 5 |
|
5 | 6 | const gbs = require('./config/globals');
|
6 | 7 | const core = require('./app/core');
|
7 | 8 |
|
8 | 9 | //Actual backend
|
9 | 10 | const backend = require('./app/backend');
|
10 | 11 |
|
| 12 | +let logo = path.join(__dirname, 'public', 'logo.png'); |
| 13 | +let logoGrey = path.join(__dirname, 'public', 'logo-grey.png'); |
| 14 | + |
11 | 15 | function createWindow () {
|
12 | 16 | // Create the browser window.
|
13 | 17 | gbs.win = new BrowserWindow({
|
14 | 18 | width: 600,
|
15 | 19 | height: 250,
|
16 |
| - icon: "public/logo.png", |
| 20 | + icon: logo, |
17 | 21 | webPreferences: {
|
18 | 22 | //nodeIntegration: false
|
19 | 23 | },
|
@@ -41,7 +45,7 @@ function createWindow () {
|
41 | 45 | }
|
42 | 46 |
|
43 | 47 | function generateTray() {
|
44 |
| - gbs.tray = new Tray('public/logo.png'); |
| 48 | + gbs.tray = new Tray(logo); |
45 | 49 |
|
46 | 50 | gbs.trayMenu = Menu.buildFromTemplate([
|
47 | 51 | {
|
@@ -88,7 +92,7 @@ async function launch() {
|
88 | 92 |
|
89 | 93 | function updateTrayIcon() {
|
90 | 94 | console.log("Updating tray icon, connected: ", gbs.connected);
|
91 |
| - let path = gbs.connected ? 'public/logo.png' : 'public/logo-grey.png'; |
| 95 | + let path = gbs.connected ? logo : logoGrey; |
92 | 96 | gbs.tray.setImage(path);
|
93 | 97 | }
|
94 | 98 |
|
|
0 commit comments