1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

tray icon

This commit is contained in:
Andrew Simachev 2025-02-25 14:34:10 +01:00
parent 012a60b78b
commit 2f0294c84e
No known key found for this signature in database
GPG key ID: 1DFE44B21443F0EF

View file

@ -346,7 +346,9 @@ class MenuManager {
return;
};
this.tray = new Tray (this.getTrayIcon());
const icon = this.getTrayIcon();
this.tray = new Tray (icon);
this.tray.setToolTip('Anytype');
this.tray.setContextMenu(Menu.buildFromTemplate([
{ label: Util.translate('electronMenuOpenApp'), click: () => this.winShow() },
@ -471,7 +473,10 @@ class MenuManager {
updateTrayIcon () {
if (this.tray && this.tray.setImage) {
this.tray.setImage(this.getTrayIcon());
const icon = this.getTrayIcon();
if (icon) {
this.tray.setImage(icon);
};
};
};
@ -493,11 +498,12 @@ class MenuManager {
} else {
icon = 'iconTrayBlack.png';
};
} else {
} else
if (is.macos) {
icon = `iconTrayTemplate.png`;
};
return path.join(Util.imagePath(), icon);
return icon ? path.join(Util.imagePath(), icon) : '';
};
destroy () {