Update server console tray icons to include status
BIN
server-console/resources/console-tray-osx-stopped.png
Normal file
After ![]() (image error) Size: 1.4 KiB |
BIN
server-console/resources/console-tray-osx-stopping.png
Normal file
After ![]() (image error) Size: 1.4 KiB |
Before ![]() (image error) Size: 1.4 KiB After ![]() (image error) Size: 1.4 KiB ![]() ![]() |
BIN
server-console/resources/console-tray-osx@2x-stopped.png
Normal file
After ![]() (image error) Size: 1.7 KiB |
BIN
server-console/resources/console-tray-osx@2x-stopping.png
Normal file
After ![]() (image error) Size: 1.7 KiB |
Before ![]() (image error) Size: 1.6 KiB After ![]() (image error) Size: 1.6 KiB ![]() ![]() |
BIN
server-console/resources/console-tray-win-stopped.png
Normal file
After ![]() (image error) Size: 1.6 KiB |
BIN
server-console/resources/console-tray-win-stopping.png
Normal file
After ![]() (image error) Size: 1.6 KiB |
Before ![]() (image error) Size: 1.5 KiB After ![]() (image error) Size: 1.5 KiB ![]() ![]() |
BIN
server-console/resources/console-tray-win@2x-stopped.png
Normal file
After ![]() (image error) Size: 2.4 KiB |
BIN
server-console/resources/console-tray-win@2x-stopping.png
Normal file
After ![]() (image error) Size: 2.4 KiB |
Before ![]() (image error) Size: 2.4 KiB After ![]() (image error) Size: 2.4 KiB ![]() ![]() |
|
@ -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() {
|
||||
|
|