Update server console tray icons to include status
BIN
server-console/resources/console-tray-osx-stopped.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
server-console/resources/console-tray-osx-stopping.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
server-console/resources/console-tray-osx@2x-stopped.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
server-console/resources/console-tray-osx@2x-stopping.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
server-console/resources/console-tray-win-stopped.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
server-console/resources/console-tray-win-stopping.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
server-console/resources/console-tray-win@2x-stopped.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
server-console/resources/console-tray-win@2x-stopping.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
@ -3,6 +3,7 @@
|
||||||
const electron = require('electron');
|
const electron = require('electron');
|
||||||
const app = electron.app; // Module to control application life.
|
const app = electron.app; // Module to control application life.
|
||||||
const BrowserWindow = electron.BrowserWindow;
|
const BrowserWindow = electron.BrowserWindow;
|
||||||
|
const nativeImage = electron.nativeImage;
|
||||||
|
|
||||||
const notifier = require('node-notifier');
|
const notifier = require('node-notifier');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
|
@ -594,6 +595,7 @@ function updateMenuArray(menuArray, serverState) {
|
||||||
function updateTrayMenu(serverState) {
|
function updateTrayMenu(serverState) {
|
||||||
if (tray) {
|
if (tray) {
|
||||||
var menuArray = buildMenuArray(serverState);
|
var menuArray = buildMenuArray(serverState);
|
||||||
|
tray.setImage(trayIcons[serverState]);
|
||||||
tray.setContextMenu(Menu.buildFromTemplate(menuArray));
|
tray.setContextMenu(Menu.buildFromTemplate(menuArray));
|
||||||
if (isShuttingDown) {
|
if (isShuttingDown) {
|
||||||
tray.setToolTip('High Fidelity - Shutting Down');
|
tray.setToolTip('High Fidelity - Shutting Down');
|
||||||
|
@ -730,8 +732,18 @@ function maybeShowSplash() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const trayFilename = (osType == "Darwin" ? "console-tray-Template.png" : "console-tray.png");
|
const trayIconOS = (osType == "Darwin") ? "osx" : "win";
|
||||||
const trayIcon = path.join(__dirname, '../resources/' + trayFilename);
|
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');
|
const notificationIcon = path.join(__dirname, '../resources/console-notification.png');
|
||||||
|
|
||||||
|
@ -745,7 +757,7 @@ app.on('ready', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create tray icon
|
// Create tray icon
|
||||||
tray = new Tray(trayIcon);
|
tray = new Tray(trayIcons[ProcessGroupStates.STOPPED]);
|
||||||
tray.setToolTip('High Fidelity Server Console');
|
tray.setToolTip('High Fidelity Server Console');
|
||||||
|
|
||||||
tray.on('click', function() {
|
tray.on('click', function() {
|
||||||
|
|