feat(tray): use checkbox for show windows and move to top

This commit is contained in:
Elian Doran 2025-02-01 02:46:33 +02:00
parent 839e8a4143
commit 4bd9d32c74
No known key found for this signature in database

View File

@ -111,7 +111,21 @@ function updateTrayMenu() {
const contextMenu = Menu.buildFromTemplate([ 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", type: "normal",
click: () => triggerKeyboardAction("createNoteIntoInbox") click: () => triggerKeyboardAction("createNoteIntoInbox")
}, },
@ -132,20 +146,7 @@ function updateTrayMenu() {
}, },
{ type: "separator" }, { type: "separator" },
{ {
label: isVisible ? "Hide" : "Show", label: "Quit Trilium",
type: "normal",
click: () => {
if (isVisible) {
mainWindow.hide();
} else {
mainWindow.show();
mainWindow.focus();
}
}
},
{ type: "separator" },
{
label: "Quit",
type: "normal", type: "normal",
click: () => { click: () => {
mainWindow.close(); mainWindow.close();