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 = [] }
[dependencies]
tauri = { version = "2.10.3", features = [] }
tauri = { version = "2.10.3", features = ["macos-private-api"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
window-vibrancy = "0.7.1"
[profile.release]
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)]
pub fn run() {
tauri::Builder::default()
.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!())
.expect("error while running tauri application");
}
+7 -2
View File
@@ -10,12 +10,14 @@
"frontendDist": "../out"
},
"app": {
"macOSPrivateApi": true,
"withGlobalTauri": true,
"windows": [
{
"title": "disksense",
"width": 800,
"height": 600
"height": 600,
"transparent": true
}
],
"security": {
@@ -31,6 +33,9 @@
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
],
"macOS": {
"minimumSystemVersion": "13.0"
}
}
}