mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(tray): use checkbox for show windows and move to top
This commit is contained in:
parent
839e8a4143
commit
4bd9d32c74
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user