From 4bd9d32c74c5081ed9aed938e9d6a1309f64d377 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 1 Feb 2025 02:46:33 +0200 Subject: [PATCH] feat(tray): use checkbox for show windows and move to top --- src/services/tray.ts | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/services/tray.ts b/src/services/tray.ts index 95962ae0e..600898bdf 100644 --- a/src/services/tray.ts +++ b/src/services/tray.ts @@ -111,7 +111,21 @@ function updateTrayMenu() { const contextMenu = Menu.buildFromTemplate([ { - label: "New Note", + label: "Show windows", + type: "checkbox", + checked: isVisible, + click: () => { + if (isVisible) { + mainWindow.hide(); + } else { + mainWindow.show(); + mainWindow.focus(); + } + } + }, + { type: "separator" }, + { + label: "New note", type: "normal", click: () => triggerKeyboardAction("createNoteIntoInbox") }, @@ -132,20 +146,7 @@ function updateTrayMenu() { }, { type: "separator" }, { - label: isVisible ? "Hide" : "Show", - type: "normal", - click: () => { - if (isVisible) { - mainWindow.hide(); - } else { - mainWindow.show(); - mainWindow.focus(); - } - } - }, - { type: "separator" }, - { - label: "Quit", + label: "Quit Trilium", type: "normal", click: () => { mainWindow.close();