Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(native-buttons): regressions on mac
Elian Doran88a93e3a7be6
diff --git a/src/public/app/desktop.js b/src/public/app/desktop.jsindex c07040a243..a848366ccb 100644--- a/src/public/app/desktop.js+++ b/src/public/app/desktop.js@@ -66,7 +66,6 @@ function initTitleBarButtons() {currentWindow.setTitleBarOverlay({ color, symbolColor });}- // FIXME: call only on darwinif (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);diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.jsindex b9d20feae1..04c4cef730 100644--- a/src/public/app/layouts/desktop_layout.js+++ b/src/public/app/layouts/desktop_layout.js@@ -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)diff --git a/src/views/desktop.ejs b/src/views/desktop.ejsindex 3e1ce72291..29afdcfd35 100644--- a/src/views/desktop.ejs+++ b/src/views/desktop.ejs@@ -37,7 +37,7 @@assetPath: "<%= assetPath %>",appPath: "<%= appPath %>",platform: "<%= platform %>",- hasNativeTitleBar: "<%= hasNativeTitleBar %>",+ hasNativeTitleBar: <%= hasNativeTitleBar %>,TRILIUM_SAFE_MODE: <%= !!process.env.TRILIUM_SAFE_MODE %>};</script>