mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
feat(electron): set overlay information at runtime
This commit is contained in:
parent
0089346d04
commit
60192977c9
@ -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.");
|
||||
}
|
@ -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; */
|
||||
|
Loading…
x
Reference in New Issue
Block a user