From 6c191800e01e8cbd2029225808aadfd3163a3cc0 Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Sun, 7 Feb 2021 17:10:18 +0530 Subject: [PATCH] Add option to keep window always on top --- app/commands.ts | 3 +++ app/menus/menus/window.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/app/commands.ts b/app/commands.ts index c7b01b63..0ee59668 100644 --- a/app/commands.ts +++ b/app/commands.ts @@ -130,6 +130,9 @@ const commands: Record void> = { }, 'systemContextMenu:remove': () => { systemContextMenu.remove(); + }, + 'window:toggleKeepOnTop': (focusedWindow) => { + focusedWindow?.setAlwaysOnTop(!focusedWindow.isAlwaysOnTop()); } }; diff --git a/app/menus/menus/window.ts b/app/menus/menus/window.ts index 8ea018dc..56db6fe5 100644 --- a/app/menus/menus/window.ts +++ b/app/menus/menus/window.ts @@ -81,6 +81,12 @@ export default ( { role: 'front' }, + { + label: 'Toggle Always on Top', + click: (item, focusedWindow) => { + execCommand('window:toggleKeepOnTop', focusedWindow); + } + }, { role: 'togglefullscreen', accelerator: commandKeys['window:toggleFullScreen']