test with tray icon with default icon 1024 px

pull/1804/head
Audric Ackermann 4 years ago
parent 16e80b8649
commit 63cad6b05b
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -7,16 +7,7 @@ let trayContextMenu = null;
let tray = null; let tray = null;
function createTrayIcon(getMainWindow, messages) { function createTrayIcon(getMainWindow, messages) {
// A smaller icon is needed on macOS const iconNoNewMessages = path.join(__dirname, '..', 'images', 'session', `session_icon.png`);
const iconSize = process.platform === 'darwin' ? '16' : '256';
const iconNoNewMessages = path.join(
__dirname,
'..',
'images',
'session',
`session_icon_${iconSize}.png`
);
tray = new Tray(iconNoNewMessages); tray = new Tray(iconNoNewMessages);
tray.forceOnTop = mainWindow => { tray.forceOnTop = mainWindow => {
@ -79,15 +70,8 @@ function createTrayIcon(getMainWindow, messages) {
tray.setContextMenu(trayContextMenu); tray.setContextMenu(trayContextMenu);
}; };
tray.updateIcon = unreadCount => { tray.updateIcon = () => {
let image; const image = iconNoNewMessages;
if (unreadCount > 0) {
const filename = `${String(unreadCount >= 10 ? 10 : unreadCount)}.png`;
image = path.join(__dirname, '..', 'images', 'alert', iconSize, filename);
} else {
image = iconNoNewMessages;
}
if (!fs.existsSync(image)) { if (!fs.existsSync(image)) {
console.log('tray.updateIcon: Image for tray update does not exist!'); console.log('tray.updateIcon: Image for tray update does not exist!');

Loading…
Cancel
Save