feat(kopiaui): support both left and right click to open tray menu (#1805)

* feat(kopiaui): support both left and right click to open tray menu

Fixes #1798

* feat(kopiaui): show all repository windows on double click
This commit is contained in:
Jarek Kowalski
2022-03-06 21:09:01 -08:00
committed by GitHub
parent 353e8b1ff4
commit 436933caa1

View File

@@ -305,6 +305,15 @@ function showAllRepoWindows() {
allConfigs().forEach(showRepoWindow);
}
function safeTrayHandler(ev, h) {
tray.on(ev, () => {
try {
h();
} catch (e) {
}
})
}
app.on('ready', () => {
loadConfigs();
@@ -327,6 +336,11 @@ app.on('ready', () => {
selectByOS({ mac: 'kopia-tray.png', win: 'kopia-tray.ico', linux: 'kopia-tray.png' })));
tray.setToolTip('Kopia');
safeTrayHandler("click", () => tray.popUpContextMenu());
safeTrayHandler("right-click", () => tray.popUpContextMenu());
safeTrayHandler("double-click", () => showAllRepoWindows());
updateTrayContextMenu();
refreshWillLaunchAtStartup();
updateDockIcon();