mirror of
https://github.com/kopia/kopia.git
synced 2026-04-29 02:15:39 -04:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user