Add tray icon for linux (Ubuntu ambiance style for now).
This commit is contained in:
@@ -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) {
|
var showUnreadBadge = function(unreadCount, mentionCount) {
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
@@ -494,6 +509,10 @@ var showUnreadBadge = function(unreadCount, mentionCount) {
|
|||||||
case 'darwin':
|
case 'darwin':
|
||||||
showUnreadBadgeOSX(unreadCount, mentionCount);
|
showUnreadBadgeOSX(unreadCount, mentionCount);
|
||||||
break;
|
break;
|
||||||
|
case 'linux':
|
||||||
|
console.log(unreadCount);
|
||||||
|
showUnreadBadgeLinux(unreadCount, mentionCount);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -63,6 +63,12 @@ const trayImages = function() {
|
|||||||
unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconUnreadTemplate.png')),
|
unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconUnreadTemplate.png')),
|
||||||
mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconMentionTemplate.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:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@@ -73,7 +79,7 @@ function shouldShowTrayIcon() {
|
|||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (process.platform === 'darwin' && config.showTrayIcon === true) {
|
if (['darwin', 'linux'].includes(process.platform) && config.showTrayIcon === true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
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 |
Reference in New Issue
Block a user