From ea323e508bc54814cfdbbe7c80f064cbf9537b2f Mon Sep 17 00:00:00 2001 From: Yuri Karamian Date: Fri, 13 Feb 2026 01:16:08 +0100 Subject: [PATCH] Add macOS native titlebar support --- src-tauri/tauri.macos.conf.json | 16 ++++++++++++++++ src/lib/components/AppLayout.svelte | 9 ++++++++- src/lib/components/TitleBar.svelte | 10 +++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 src-tauri/tauri.macos.conf.json diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json new file mode 100644 index 0000000..0d496ba --- /dev/null +++ b/src-tauri/tauri.macos.conf.json @@ -0,0 +1,16 @@ +{ + "app": { + "windows": [ + { + "label": "main", + "decorations": true, + "titleBarStyle": "Overlay", + "hiddenTitle": true, + "trafficLightPosition": { + "x": 12, + "y": 10 + } + } + ] + } +} diff --git a/src/lib/components/AppLayout.svelte b/src/lib/components/AppLayout.svelte index 0e2c430..ad0d6f7 100644 --- a/src/lib/components/AppLayout.svelte +++ b/src/lib/components/AppLayout.svelte @@ -28,6 +28,7 @@ } from '$lib/stores/app'; const appWindow = getCurrentWindow(); + const isMac = navigator.platform.startsWith('Mac'); import { loadVaultState, saveVaultState, readNote } from '$lib/api'; import { debounce } from '$lib/utils/debounce'; import type { VaultState, FileEvent } from '$lib/types'; @@ -211,7 +212,7 @@
{#if $focusMode} -
{ if (!(e.target as HTMLElement).closest('button')) appWindow.startDragging(); }}> +
{ if (!(e.target as HTMLElement).closest('button')) appWindow.startDragging(); }}> {$activeNote?.meta.title || 'Untitled'}
+ {#if !isMac} @@ -228,6 +230,7 @@ + {/if}
{:else} @@ -349,4 +352,8 @@ background: #e81123; color: white; } + + .focus-topbar.macos { + padding-left: 78px; + } diff --git a/src/lib/components/TitleBar.svelte b/src/lib/components/TitleBar.svelte index bc81e24..b558a1d 100644 --- a/src/lib/components/TitleBar.svelte +++ b/src/lib/components/TitleBar.svelte @@ -7,6 +7,7 @@ } = $props(); const appWindow = getCurrentWindow(); + const isMac = navigator.platform.startsWith('Mac'); let maximized = $state(false); async function checkMaximized() { @@ -59,7 +60,7 @@ -
+
@@ -96,6 +97,7 @@ New Note
+ {#if !isMac}
+ {/if}