Add clicked icons
This commit is contained in:
11
src/main.js
11
src/main.js
@@ -65,7 +65,12 @@ const trayImages = function() {
|
||||
return {
|
||||
normal: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIcon.png')),
|
||||
unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconUnread.png')),
|
||||
mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconMention.png'))
|
||||
mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconMention.png')),
|
||||
clicked: {
|
||||
normal: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/ClickedMenuIcon.png')),
|
||||
unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/ClickedMenuIconUnread.png')),
|
||||
mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/ClickedMenuIconMention.png'))
|
||||
}
|
||||
};
|
||||
case 'linux':
|
||||
var resourcesDir = 'resources/linux/' + (config.trayIconTheme || 'light') + '/';
|
||||
@@ -173,6 +178,7 @@ app.on('ready', function() {
|
||||
if (shouldShowTrayIcon()) {
|
||||
// set up tray icon
|
||||
trayIcon = new Tray(trayImages.normal);
|
||||
trayIcon.setPressedImage(trayImages.clicked.normal);
|
||||
trayIcon.setToolTip(app.getName());
|
||||
trayIcon.on('click', function() {
|
||||
mainWindow.focus();
|
||||
@@ -201,14 +207,17 @@ app.on('ready', function() {
|
||||
|
||||
if (arg.mentionCount > 0) {
|
||||
trayIcon.setImage(trayImages.mention);
|
||||
trayIcon.setPressedImage(trayImages.clicked.mention);
|
||||
trayIcon.setToolTip(arg.mentionCount + ' unread mentions');
|
||||
}
|
||||
else if (arg.unreadCount > 0) {
|
||||
trayIcon.setImage(trayImages.unread);
|
||||
trayIcon.setPressedImage(trayImages.clicked.unread);
|
||||
trayIcon.setToolTip(arg.unreadCount + ' unread channels');
|
||||
}
|
||||
else {
|
||||
trayIcon.setImage(trayImages.normal);
|
||||
trayIcon.setPressedImage(trayImages.clicked.normal);
|
||||
trayIcon.setToolTip(app.getName());
|
||||
}
|
||||
});
|
||||
|
BIN
src/resources/osx/ClickedMenuIcon.png
Normal file
BIN
src/resources/osx/ClickedMenuIcon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 440 B |
BIN
src/resources/osx/ClickedMenuIcon@2x.png
Normal file
BIN
src/resources/osx/ClickedMenuIcon@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 913 B |
BIN
src/resources/osx/ClickedMenuIconMention.png
Normal file
BIN
src/resources/osx/ClickedMenuIconMention.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 520 B |
BIN
src/resources/osx/ClickedMenuIconMention@2x.png
Normal file
BIN
src/resources/osx/ClickedMenuIconMention@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
src/resources/osx/ClickedMenuIconUnread.png
Normal file
BIN
src/resources/osx/ClickedMenuIconUnread.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 480 B |
BIN
src/resources/osx/ClickedMenuIconUnread@2x.png
Normal file
BIN
src/resources/osx/ClickedMenuIconUnread@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1023 B |
Reference in New Issue
Block a user