mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-08 17:22:29 +08:00
fix(native-buttons): runtime errors due to missing functions
This commit is contained in:
parent
91a8460eea
commit
ef6410f25d
@ -62,16 +62,17 @@ function initTitleBarButtons() {
|
|||||||
const color = style.getPropertyValue("--native-titlebar-background");
|
const color = style.getPropertyValue("--native-titlebar-background");
|
||||||
const symbolColor = style.getPropertyValue("--native-titlebar-foreground");
|
const symbolColor = style.getPropertyValue("--native-titlebar-foreground");
|
||||||
|
|
||||||
if (color && symbolColor) {
|
if (window.glob.platform === "win32" && color && symbolColor) {
|
||||||
// FIXME, do this only on windows
|
currentWindow.setTitleBarOverlay({ color, symbolColor });
|
||||||
// currentWindow.setTitleBarOverlay({ color, symbolColor });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: call only on darwin
|
// FIXME: call only on darwin
|
||||||
|
if (window.glob.platform === "darwin") {
|
||||||
const xOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-x-offset"), 10);
|
const xOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-x-offset"), 10);
|
||||||
const yOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-y-offset"), 10);
|
const yOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-y-offset"), 10);
|
||||||
currentWindow.setWindowButtonPosition({ x: xOffset, y: yOffset });
|
currentWindow.setWindowButtonPosition({ x: xOffset, y: yOffset });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update the native title bar buttons.
|
// Update the native title bar buttons.
|
||||||
applyTitleBarOverlaySettings();
|
applyTitleBarOverlaySettings();
|
||||||
|
@ -96,7 +96,7 @@ export default class DesktopLayout {
|
|||||||
const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");
|
const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");
|
||||||
const launcherPane = this.#buildLauncherPane(launcherPaneIsHorizontal);
|
const launcherPane = this.#buildLauncherPane(launcherPaneIsHorizontal);
|
||||||
const isMac = (window.glob.platform === "darwin");
|
const isMac = (window.glob.platform === "darwin");
|
||||||
const isWindows = (window.glob.platform === "windows");
|
const isWindows = (window.glob.platform === "win32");
|
||||||
const hasNativeTitleBar = (window.glob.hasNativeTitleBar);
|
const hasNativeTitleBar = (window.glob.hasNativeTitleBar);
|
||||||
const fullWidthTabBar = (launcherPaneIsHorizontal && !isMac);
|
const fullWidthTabBar = (launcherPaneIsHorizontal && !isMac);
|
||||||
const customTitleBarButtons = (hasNativeTitleBar && !isMac && !isWindows);
|
const customTitleBarButtons = (hasNativeTitleBar && !isMac && !isWindows);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user