From 7f085796716e0e7a6ef5db1acb9a9a267d52b309 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Mon, 21 Mar 2022 18:17:22 +0200 Subject: [PATCH] add always-on-top option --- index.js | 4 ++++ menu.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/index.js b/index.js index 2fdfac5822..0d5762313b 100644 --- a/index.js +++ b/index.js @@ -165,6 +165,10 @@ function createMainWindow() { win.maximize(); } + if(config.get("options.alwaysOnTop")){ + win.setAlwaysOnTop(true); + } + const urlToLoad = config.get("options.resumeOnStart") ? config.get("url") : config.defaultConfig.url; diff --git a/menu.js b/menu.js index dda0f086e8..ee9e8f8677 100644 --- a/menu.js +++ b/menu.js @@ -100,6 +100,15 @@ const mainMenuTemplate = (win) => { } }, }, + { + label: "Always on top", + type: "checkbox", + checked: config.get("options.alwaysOnTop"), + click: (item) => { + config.setMenuOption("options.alwaysOnTop", item.checked); + win.setAlwaysOnTop(item.checked); + }, + }, ...(is.windows() || is.linux() ? [ {