Fix for non-darwin platforms
This commit is contained in:
@@ -199,11 +199,13 @@ app.on('ready', function() {
|
|||||||
if (shouldShowTrayIcon()) {
|
if (shouldShowTrayIcon()) {
|
||||||
// set up tray icon
|
// set up tray icon
|
||||||
trayIcon = new Tray(trayImages.normal);
|
trayIcon = new Tray(trayImages.normal);
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
trayIcon.setPressedImage(trayImages.clicked.normal);
|
trayIcon.setPressedImage(trayImages.clicked.normal);
|
||||||
systemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', (event, userInfo) => {
|
systemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', (event, userInfo) => {
|
||||||
switchMenuIconImages(trayImages, systemPreferences.isDarkMode());
|
switchMenuIconImages(trayImages, systemPreferences.isDarkMode());
|
||||||
trayIcon.setImage(trayImages.normal);
|
trayIcon.setImage(trayImages.normal);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
trayIcon.setToolTip(app.getName());
|
trayIcon.setToolTip(app.getName());
|
||||||
trayIcon.on('click', function() {
|
trayIcon.on('click', function() {
|
||||||
@@ -233,17 +235,23 @@ app.on('ready', function() {
|
|||||||
|
|
||||||
if (arg.mentionCount > 0) {
|
if (arg.mentionCount > 0) {
|
||||||
trayIcon.setImage(trayImages.mention);
|
trayIcon.setImage(trayImages.mention);
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
trayIcon.setPressedImage(trayImages.clicked.mention);
|
trayIcon.setPressedImage(trayImages.clicked.mention);
|
||||||
|
}
|
||||||
trayIcon.setToolTip(arg.mentionCount + ' unread mentions');
|
trayIcon.setToolTip(arg.mentionCount + ' unread mentions');
|
||||||
}
|
}
|
||||||
else if (arg.unreadCount > 0) {
|
else if (arg.unreadCount > 0) {
|
||||||
trayIcon.setImage(trayImages.unread);
|
trayIcon.setImage(trayImages.unread);
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
trayIcon.setPressedImage(trayImages.clicked.unread);
|
trayIcon.setPressedImage(trayImages.clicked.unread);
|
||||||
|
}
|
||||||
trayIcon.setToolTip(arg.unreadCount + ' unread channels');
|
trayIcon.setToolTip(arg.unreadCount + ' unread channels');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
trayIcon.setImage(trayImages.normal);
|
trayIcon.setImage(trayImages.normal);
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
trayIcon.setPressedImage(trayImages.clicked.normal);
|
trayIcon.setPressedImage(trayImages.clicked.normal);
|
||||||
|
}
|
||||||
trayIcon.setToolTip(app.getName());
|
trayIcon.setToolTip(app.getName());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user