mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 02:42:27 +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();
|
glob.setupGlobs();
|
||||||
|
|
||||||
if (utils.isElectron()) {
|
if (utils.isElectron()) {
|
||||||
utils.dynamicRequire('electron').ipcRenderer.on('globalShortcut',
|
initOnElectron();
|
||||||
async (event, actionName) => appContext.triggerCommand(actionName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
macInit.init();
|
macInit.init();
|
||||||
@ -43,3 +42,18 @@ noteAutocompleteService.init();
|
|||||||
if (utils.isElectron()) {
|
if (utils.isElectron()) {
|
||||||
electronContextMenu.setupContextMenu();
|
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 {
|
:root {
|
||||||
/* --main-font-family: "Noto Sans", sans-serif; */
|
/* --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: "Ubuntu", sans-serif; */
|
||||||
/* --main-font-family: "Nunito", sans-serif; */
|
/* --main-font-family: "Nunito", sans-serif; */
|
||||||
/* --main-font-family: "Inter", sans-serif; */
|
/* --main-font-family: "Inter", sans-serif; */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user