From 4601628a55b701bfb0b4a07ec2c0c1a0d2217a28 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Fri, 17 Apr 2026 06:39:42 -0700 Subject: [PATCH] Start working on transparency --- src-tauri/Cargo.toml | 1 + src-tauri/src/lib.rs | 6 +++++ src-tauri/tauri.macos.conf.json | 3 ++- src/app/main/layout.tsx | 5 +--- src/app/main/settings/page.tsx | 22 ---------------- src/providers/GlobalProvider.tsx | 1 - src/styles/globals.css | 43 +------------------------------- 7 files changed, 11 insertions(+), 70 deletions(-) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d1adc9f..2053b3b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -37,6 +37,7 @@ tauri-plugin-http = "2.5.8" dashmap = "6.1.0" tauri-plugin-store = "2.4.2" hex = "0.4.3" +window-vibrancy = "0.7.1" [target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies] sysinfo = "0.38.4" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 3f6fc8d..2cf79a2 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -21,6 +21,8 @@ use tauri_plugin_os::platform; use tauri_plugin_prevent_default::Flags; use tokio::io::AsyncReadExt; use tokio::{io::AsyncWriteExt, time::timeout}; +#[cfg(target_os = "macos")] +use window_vibrancy::{NSVisualEffectMaterial, apply_vibrancy}; use zip::ZipArchive; use zip::result::ZipError; @@ -749,6 +751,10 @@ pub fn run() { let window = app.get_webview_window("main").unwrap(); + #[cfg(target_os = "macos")] + apply_vibrancy(&window, NSVisualEffectMaterial::HudWindow, None, None) + .expect("Unable to apply window blur"); + #[cfg(target_os = "windows")] { use tauri_plugin_decorum::WebviewWindowExt; diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index 39fe40e..888ef0a 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -20,7 +20,8 @@ "minWidth": 1000, "minHeight": 500, "titleBarStyle": "Overlay", - "hiddenTitle": true + "hiddenTitle": true, + "transparent": true } ], "security": { diff --git a/src/app/main/layout.tsx b/src/app/main/layout.tsx index 6be0707..c55bf9e 100644 --- a/src/app/main/layout.tsx +++ b/src/app/main/layout.tsx @@ -88,7 +88,6 @@ export default function RootLayout ({ const [linuxUseWine, setLinuxUseWine] = useState(false) const [linuxWineCommand, setLinuxWineCommand] = useState('wine %path%') - const [theme, setTheme] = useState('dark') const [customDataLocation, setCustomDataLocation] = useState('') const [versionsList, setVersionsList] = useState>({}) @@ -675,7 +674,6 @@ export default function RootLayout ({ unlisteners.push(versions!.onKeyChange(key, fn)) } - watchSettings('theme', v => setTheme(v ?? 'dark')) watchSettings('notificationsAllowed', v => setNotificationsAllowed(v ?? true) ) @@ -703,7 +701,7 @@ export default function RootLayout ({ return ( <> - + {loading ? ( <>
)} -
-

- Theme: -

- { - await settings?.set('theme', val) - }} - /> -

modsList: Record> diff --git a/src/styles/globals.css b/src/styles/globals.css index 53d6954..e99f51d 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -5,10 +5,8 @@ html { } body { - @apply bg-(--col0) text-white select-none; -} + @apply bg-transparent text-white select-none; -.dark-theme { --col0: rgb(8, 8, 8); --col1: rgb(16, 16, 16); --col2: rgb(32, 32, 32); @@ -21,45 +19,6 @@ body { --col9: rgb(144, 144, 144); } -.red-theme { - --col0: rgb(32, 8, 8); - --col1: rgb(40, 16, 16); - --col2: rgb(56, 32, 32); - --col3: rgb(72, 48, 48); - --col4: rgb(88, 64, 64); - --col5: rgb(104, 80, 80); - --col6: rgb(120, 96, 96); - --col7: rgb(136, 112, 112); - --col8: rgb(152, 128, 128); - --col9: rgb(168, 144, 144); -} - -.blue-theme { - --col0: rgb(8, 8, 32); - --col1: rgb(16, 16, 40); - --col2: rgb(32, 32, 56); - --col3: rgb(48, 48, 72); - --col4: rgb(64, 64, 88); - --col5: rgb(80, 80, 104); - --col6: rgb(96, 96, 120); - --col7: rgb(112, 112, 136); - --col8: rgb(128, 128, 152); - --col9: rgb(144, 144, 168); -} - -.purple-theme { - --col0: rgb(20, 8, 32); - --col1: rgb(28, 16, 40); - --col2: rgb(44, 32, 56); - --col3: rgb(60, 48, 72); - --col4: rgb(76, 64, 88); - --col5: rgb(92, 80, 104); - --col6: rgb(108, 96, 120); - --col7: rgb(124, 112, 136); - --col8: rgb(140, 128, 152); - --col9: rgb(156, 144, 168); -} - .button { @apply rounded-md cursor-pointer text-[16px] py-1 px-2 transition-colors border; }