3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-12 17:52:30 +02:00

Update server console tray icons to include status

This commit is contained in:
Ryan Huffman 2016-02-10 13:45:19 -08:00
parent 5120076add
commit eabe3188b3
13 changed files with 15 additions and 3 deletions

Binary file not shown.

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.4 KiB

View file

Before

(image error) Size: 1.4 KiB

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 1.7 KiB

Binary file not shown.

After

(image error) Size: 1.7 KiB

View file

Before

(image error) Size: 1.6 KiB

After

(image error) Size: 1.6 KiB

Binary file not shown.

After

(image error) Size: 1.6 KiB

Binary file not shown.

After

(image error) Size: 1.6 KiB

View file

Before

(image error) Size: 1.5 KiB

After

(image error) Size: 1.5 KiB

Binary file not shown.

After

(image error) Size: 2.4 KiB

Binary file not shown.

After

(image error) Size: 2.4 KiB

View file

Before

(image error) Size: 2.4 KiB

After

(image error) Size: 2.4 KiB

View file

@ -3,6 +3,7 @@
const electron = require('electron');
const app = electron.app; // Module to control application life.
const BrowserWindow = electron.BrowserWindow;
const nativeImage = electron.nativeImage;
const notifier = require('node-notifier');
const util = require('util');
@ -594,6 +595,7 @@ function updateMenuArray(menuArray, serverState) {
function updateTrayMenu(serverState) {
if (tray) {
var menuArray = buildMenuArray(serverState);
tray.setImage(trayIcons[serverState]);
tray.setContextMenu(Menu.buildFromTemplate(menuArray));
if (isShuttingDown) {
tray.setToolTip('High Fidelity - Shutting Down');
@ -730,8 +732,18 @@ function maybeShowSplash() {
}
}
const trayFilename = (osType == "Darwin" ? "console-tray-Template.png" : "console-tray.png");
const trayIcon = path.join(__dirname, '../resources/' + trayFilename);
const trayIconOS = (osType == "Darwin") ? "osx" : "win";
var trayIcons = {};
trayIcons[ProcessGroupStates.STARTED] = "console-tray-" + trayIconOS + ".png";
trayIcons[ProcessGroupStates.STOPPED] = "console-tray-" + trayIconOS + "-stopped.png";
trayIcons[ProcessGroupStates.STOPPING] = "console-tray-" + trayIconOS + "-stopping.png";
for (var key in trayIcons) {
var fullPath = path.join(__dirname, '../resources/' + trayIcons[key]);
var img = nativeImage.createFromPath(fullPath);
img.setTemplateImage(osType == 'Darwin');
trayIcons[key] = img;
}
const notificationIcon = path.join(__dirname, '../resources/console-notification.png');
@ -745,7 +757,7 @@ app.on('ready', function() {
}
// Create tray icon
tray = new Tray(trayIcon);
tray = new Tray(trayIcons[ProcessGroupStates.STOPPED]);
tray.setToolTip('High Fidelity Server Console');
tray.on('click', function() {