Add window blur & set minimum macOS version

This commit is contained in:
Lncvrt committed 2026-04-14 17:29:22 -07:00
1 parent 783a689f1d
commit 7576411a66
4 files changed
+34 -3

No files matched your search

+2 -1
View File
@@ -12,9 +12,10 @@ crate-type = ["staticlib", "cdylib", "rlib"]
tauri-build = { version = "2.5.6", features = [] } tauri-build = { version = "2.5.6", features = [] }
[dependencies] [dependencies]
tauri = { version = "2.10.3", features = [] } tauri = { version = "2.10.3", features = ["macos-private-api"] }
serde = { version = "1.0.228", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149" serde_json = "1.0.149"
window-vibrancy = "0.7.1"
[profile.release] [profile.release]
opt-level = 3 opt-level = 3
+20
View File
@@ -1,7 +1,27 @@
use tauri::Manager;
#[cfg(target_os = "macos")]
use window_vibrancy::{NSVisualEffectMaterial, apply_vibrancy};
#[cfg(target_os = "windows")]
use window_vibrancy::apply_mica;
#[cfg_attr(mobile, tauri::mobile_entry_point)] #[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() { pub fn run() {
tauri::Builder::default() tauri::Builder::default()
.invoke_handler(tauri::generate_handler![]) .invoke_handler(tauri::generate_handler![])
.setup(|app| {
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")]
apply_mica(&window, Some(true)).expect("Unable to apply window blur");
Ok(())
})
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");
} }
+7 -2
View File
@@ -10,12 +10,14 @@
"frontendDist": "../out" "frontendDist": "../out"
}, },
"app": { "app": {
"macOSPrivateApi": true,
"withGlobalTauri": true, "withGlobalTauri": true,
"windows": [ "windows": [
{ {
"title": "disksense", "title": "disksense",
"width": 800, "width": 800,
"height": 600 "height": 600,
"transparent": true
} }
], ],
"security": { "security": {
@@ -31,6 +33,9 @@
"icons/128x128@2x.png", "icons/128x128@2x.png",
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
] ],
"macOS": {
"minimumSystemVersion": "13.0"
}
} }
} }
+5
View File
@@ -1 +1,6 @@
@import "tailwindcss"; @import "tailwindcss";
html,
body {
@apply bg-transparent;
}