mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
feat(electron): set overlay information at runtime
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
Reference in New Issue
Block a user