fix(native-buttons): regressions on mac

This commit is contained in:
Elian Doran 2024-12-07 00:14:05 +02:00
parent aad2f93844
commit 88a93e3a7b
No known key found for this signature in database
3 changed files with 7 additions and 3 deletions

View File

@ -66,7 +66,6 @@ function initTitleBarButtons() {
currentWindow.setTitleBarOverlay({ color, symbolColor });
}
// FIXME: call only on darwin
if (window.glob.platform === "darwin") {
const xOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-x-offset"), 10);
const yOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-y-offset"), 10);

View File

@ -98,7 +98,12 @@ export default class DesktopLayout {
const isMac = (window.glob.platform === "darwin");
const isWindows = (window.glob.platform === "win32");
const hasNativeTitleBar = (window.glob.hasNativeTitleBar);
const fullWidthTabBar = (launcherPaneIsHorizontal && !isMac);
/**
* If true, the tab bar is displayed above the launcher pane with full width; if false (default), the tab bar is displayed in the rest pane.
* On macOS we need to force the full-width tab bar on Electron in order to allow the semaphore (window controls) enough space.
*/
const fullWidthTabBar = (launcherPaneIsHorizontal || (!hasNativeTitleBar && isMac));
const customTitleBarButtons = (hasNativeTitleBar && !isMac && !isWindows);
return new RootContainer(true)

View File

@ -37,7 +37,7 @@
assetPath: "<%= assetPath %>",
appPath: "<%= appPath %>",
platform: "<%= platform %>",
hasNativeTitleBar: "<%= hasNativeTitleBar %>",
hasNativeTitleBar: <%= hasNativeTitleBar %>,
TRILIUM_SAFE_MODE: <%= !!process.env.TRILIUM_SAFE_MODE %>
};
</script>