mirror of
https://github.com/heyman/heynote.git
synced 2025-02-16 10:19:55 +01:00
Open the Heynote window when menu bar icon is left-clicked on Mac
This commit is contained in:
parent
fdfce3d9c8
commit
a5088a48af
@ -201,11 +201,18 @@ function createTray() {
|
|||||||
}
|
}
|
||||||
tray = new Tray(img);
|
tray = new Tray(img);
|
||||||
tray.setToolTip("Heynote");
|
tray.setToolTip("Heynote");
|
||||||
tray.setContextMenu(getTrayMenu(win));
|
const menu = getTrayMenu(win)
|
||||||
|
if (isMac) {
|
||||||
|
// using tray.setContextMenu() on macOS will open the menu on left-click, so instead we'll
|
||||||
|
// manually bind the right-click event to open the menu
|
||||||
|
tray.addListener("right-click", () => {
|
||||||
|
tray?.popUpContextMenu(menu)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
tray.setContextMenu(menu);
|
||||||
|
}
|
||||||
tray.addListener("click", () => {
|
tray.addListener("click", () => {
|
||||||
if (!isMac) {
|
win?.show()
|
||||||
win?.show()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user