From 60192977c9e8a07a26170c4e47c02a25c63f7a00 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 02:18:35 +0200 Subject: [PATCH] feat(electron): set overlay information at runtime --- src/public/app/desktop.js | 18 ++++++++++++++++-- src/public/stylesheets/theme-next.css | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/public/app/desktop.js b/src/public/app/desktop.js index 835624d35..313bee034 100644 --- a/src/public/app/desktop.js +++ b/src/public/app/desktop.js @@ -30,8 +30,7 @@ bundleService.getWidgetBundlesByParent().then(async widgetBundles => { glob.setupGlobs(); if (utils.isElectron()) { - utils.dynamicRequire('electron').ipcRenderer.on('globalShortcut', - async (event, actionName) => appContext.triggerCommand(actionName)); + initOnElectron(); } macInit.init(); @@ -43,3 +42,18 @@ noteAutocompleteService.init(); if (utils.isElectron()) { electronContextMenu.setupContextMenu(); } + +function initOnElectron() { + const electron = utils.dynamicRequire('electron'); + electron.ipcRenderer.on('globalShortcut', async (event, actionName) => appContext.triggerCommand(actionName)); + + // Update the native title bar buttons. + const electronRemote = utils.dynamicRequire("@electron/remote"); + const currentWindow = electronRemote.getCurrentWindow(); + currentWindow.setTitleBarOverlay({ + color: "red", + symbolColor: "white" + }); + + console.log("Electron initialized."); +} \ No newline at end of file diff --git a/src/public/stylesheets/theme-next.css b/src/public/stylesheets/theme-next.css index 22556aba9..8c3bf8536 100644 --- a/src/public/stylesheets/theme-next.css +++ b/src/public/stylesheets/theme-next.css @@ -20,7 +20,7 @@ :root { /* --main-font-family: "Noto Sans", sans-serif; */ - --main-font-family: "Ubuntu Sans", sans-serif; + --main-font-family: "Segoe UI", sans-serif; /* --main-font-family: "Ubuntu", sans-serif; */ /* --main-font-family: "Nunito", sans-serif; */ /* --main-font-family: "Inter", sans-serif; */