From 3400c5e2cc47b75e913b606649529c9f8822ad34 Mon Sep 17 00:00:00 2001 From: Oleksii Skorobogatko Date: Sat, 28 Dec 2024 11:27:45 +0200 Subject: [PATCH] #4 'show/hide' renamed to 'open main window' and persistent across platforms. --- src/main/main.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/main.js b/src/main/main.js index 7979d35..2f5b559 100644 --- a/src/main/main.js +++ b/src/main/main.js @@ -104,16 +104,13 @@ const createTrayIcon = (mainWindow) => { }, ]); - // Gnome tray does not support actions by icon clicking. - // There is a menu item does the same as clicking on the icon to show/hide the main window. - if (isPlatformLinux()) { - contextMenu.insert(0, new MenuItem({ - id: 'lnx-show-toggle', - label: 'Show/Hide', - click: () => mainWindow.toggleVisibility(), - })); - contextMenu.insert(1, new MenuItem({ type: 'separator' })); - } + contextMenu.insert(0, new MenuItem({ + id: 'open-main-window', + label: 'Open Main Window', + click: () => mainWindow.show(), + })); + + contextMenu.insert(1, new MenuItem({ type: 'separator' })); tray.setContextMenu(contextMenu); tray.setToolTip('Pasted');