From b2cdd12ce045c4368689cd6f7d2b80a28d6e70cd Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 13 May 2026 13:50:00 +1200 Subject: [PATCH] Enable transparent macOS window and UI tweaks Enable macOS private API and make the app window transparent. Add tauri feature and tauri.conf settings (macOSPrivateApi + transparent) and call set_background_color in setup to use an RGBA transparent background. Adjust CSS so body is transparent, add --radius-window, and move app background to #app/.layout with border-radius and overflow hidden to preserve rounded transparent window styling. --- frontend/css/base.css | 3 ++- frontend/css/components.css | 4 ++++ src-tauri/Cargo.toml | 2 +- src-tauri/src/lib.rs | 8 ++++++++ src-tauri/tauri.conf.json | 4 +++- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/css/base.css b/frontend/css/base.css index d6f06f4..4816241 100644 --- a/frontend/css/base.css +++ b/frontend/css/base.css @@ -27,6 +27,7 @@ /* Shape */ --radius-md: 7px; --radius-lg: 11px; + --radius-window: 14px; --shadow: 0 8px 24px rgba(0, 0, 0, 0.35); } @@ -58,7 +59,7 @@ body { margin: 0; width: 100%; height: 100%; - background: var(--bg-app); + background: transparent; color: var(--text-main); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif; font-size: 14px; diff --git a/frontend/css/components.css b/frontend/css/components.css index 88e96ca..80de0b2 100644 --- a/frontend/css/components.css +++ b/frontend/css/components.css @@ -3,6 +3,9 @@ #app { width: 100%; height: 100%; + overflow: hidden; + border-radius: var(--radius-window); + background: var(--bg-app); } .layout { @@ -11,6 +14,7 @@ grid-template-columns: 320px minmax(0, 1fr); width: 100%; height: 100%; + background: var(--bg-app); } /* ── Sidebar ──────────────────────────────────────────────────────────────── */ diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 1fc7a8c..3ae8152 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -18,7 +18,7 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2", features = [] } [dependencies] -tauri = { version = "2", features = [] } +tauri = { version = "2", features = ["macos-private-api"] } tauri-plugin-opener = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index dedb1f1..b544392 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1832,6 +1832,14 @@ pub fn run() { tauri::Builder::default() .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_opener::init()) + .setup(|app| { + use tauri::Manager; + if let Some(window) = app.get_webview_window("main") { + let _ = window + .set_background_color(Some(tauri::utils::config::Color(0, 0, 0, 0))); + } + Ok(()) + }) .invoke_handler(tauri::generate_handler![ git_clone, git_pull, diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2b2cac4..3e3dc3a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,6 +8,7 @@ }, "app": { "withGlobalTauri": true, + "macOSPrivateApi": true, "windows": [ { "title": "Gitpub Desktop", @@ -15,7 +16,8 @@ "height": 860, "minWidth": 1024, "minHeight": 680, - "decorations": false + "decorations": false, + "transparent": true } ], "security": {