Update tauri to 2.0rc
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
use tauri::{App, Manager};
|
||||
use window_vibrancy::{self, NSVisualEffectMaterial};
|
||||
use window_shadows::set_shadow;
|
||||
|
||||
|
||||
/// setup
|
||||
pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>> {
|
||||
let win = app.get_window("main").unwrap();
|
||||
let win = app.get_webview_window("main").unwrap();
|
||||
// 仅在 macOS 下执行
|
||||
#[cfg(target_os = "macos")]
|
||||
window_vibrancy::apply_vibrancy(&win, NSVisualEffectMaterial::FullScreenUI)
|
||||
@@ -14,8 +13,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
|
||||
// 仅在 windows 下执行
|
||||
#[cfg(target_os = "windows")]
|
||||
if let Err(_) = window_vibrancy::apply_mica(&win, None){
|
||||
window_vibrancy::apply_acrylic(&win, Some((10,10,10,180))).expect("Unsupport Blur Effect!")
|
||||
window_vibrancy::apply_acrylic(&win, Some((10,10,10,210))).expect("Unsupport Blur Effect!")
|
||||
}
|
||||
set_shadow(&win, true).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user