mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 07:45:51 +01:00
fix(mica): apply correct mica when switching layouts
This commit is contained in:
@@ -48,14 +48,17 @@ function initOnElectron() {
|
||||
const electron = utils.dynamicRequire('electron');
|
||||
electron.ipcRenderer.on('globalShortcut', async (event, actionName) => appContext.triggerCommand(actionName));
|
||||
|
||||
const electronRemote = utils.dynamicRequire("@electron/remote");
|
||||
const currentWindow = electronRemote.getCurrentWindow();
|
||||
|
||||
initTransparencyEffects(currentWindow);
|
||||
|
||||
if (options.get("nativeTitleBarVisible") !== "true") {
|
||||
initTitleBarButtons();
|
||||
}
|
||||
initTitleBarButtons(currentWindow);
|
||||
}
|
||||
}
|
||||
|
||||
function initTitleBarButtons() {
|
||||
const electronRemote = utils.dynamicRequire("@electron/remote");
|
||||
const currentWindow = electronRemote.getCurrentWindow();
|
||||
function initTitleBarButtons(currentWindow) {
|
||||
const style = window.getComputedStyle(document.body);
|
||||
|
||||
if (window.glob.platform === "win32") {
|
||||
@@ -80,3 +83,11 @@ function initTitleBarButtons() {
|
||||
currentWindow.setWindowButtonPosition({ x: xOffset, y: yOffset });
|
||||
}
|
||||
}
|
||||
|
||||
function initTransparencyEffects(currentWindow) {
|
||||
if (window.glob.platform === "win32") {
|
||||
const isHorizontalLayout = (options.get("layoutOrientation") === "horizontal");
|
||||
const backgroundMaterial = isHorizontalLayout ? "tabbed" : "mica";
|
||||
currentWindow.setBackgroundMaterial(backgroundMaterial);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user