Add tray icon for linux (Ubuntu ambiance style for now).
This commit is contained in:
parent
f5e31a7534
commit
5020031235
|
@ -486,6 +486,21 @@ var showUnreadBadgeOSX = function(unreadCount, mentionCount) {
|
|||
});
|
||||
}
|
||||
|
||||
var showUnreadBadgeLinux = function(unreadCount, mentionCount) {
|
||||
/*if (mentionCount > 0) {
|
||||
remote.app.dock.setBadge(mentionCount.toString());
|
||||
} else if (unreadCount > 0) {
|
||||
remote.app.dock.setBadge('•');
|
||||
} else {
|
||||
remote.app.dock.setBadge('');
|
||||
}*/
|
||||
|
||||
electron.ipcRenderer.send('update-unread', {
|
||||
unreadCount: unreadCount,
|
||||
mentionCount: mentionCount
|
||||
});
|
||||
}
|
||||
|
||||
var showUnreadBadge = function(unreadCount, mentionCount) {
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
|
@ -494,6 +509,10 @@ var showUnreadBadge = function(unreadCount, mentionCount) {
|
|||
case 'darwin':
|
||||
showUnreadBadgeOSX(unreadCount, mentionCount);
|
||||
break;
|
||||
case 'linux':
|
||||
console.log(unreadCount);
|
||||
showUnreadBadgeLinux(unreadCount, mentionCount);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,12 @@ const trayImages = function() {
|
|||
unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconUnreadTemplate.png')),
|
||||
mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconMentionTemplate.png'))
|
||||
};
|
||||
case 'linux':
|
||||
return {
|
||||
normal: nativeImage.createFromPath(path.resolve(__dirname, 'resources/linux/light/MenuIconTemplate.png')),
|
||||
unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/linux/light/MenuIconUnreadTemplate.png')),
|
||||
mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/linux/light/MenuIconMentionTemplate.png'))
|
||||
};
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
|
@ -73,7 +79,7 @@ function shouldShowTrayIcon() {
|
|||
if (process.platform === 'win32') {
|
||||
return true;
|
||||
}
|
||||
if (process.platform === 'darwin' && config.showTrayIcon === true) {
|
||||
if (['darwin', 'linux'].includes(process.platform) && config.showTrayIcon === true) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
BIN
src/resources/linux/light/MenuIconMentionTemplate.png
Normal file
BIN
src/resources/linux/light/MenuIconMentionTemplate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
src/resources/linux/light/MenuIconTemplate.png
Normal file
BIN
src/resources/linux/light/MenuIconTemplate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 836 B |
BIN
src/resources/linux/light/MenuIconUnreadTemplate.png
Normal file
BIN
src/resources/linux/light/MenuIconUnreadTemplate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in a new issue