mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
feat: support blur window
This commit is contained in:
12
src-tauri/Cargo.lock
generated
12
src-tauri/Cargo.lock
generated
@@ -54,6 +54,7 @@ dependencies = [
|
||||
"tauri",
|
||||
"tauri-build",
|
||||
"tauri-plugin-shadows",
|
||||
"tauri-plugin-vibrancy",
|
||||
"tokio",
|
||||
"warp",
|
||||
"winreg 0.10.1",
|
||||
@@ -3369,6 +3370,17 @@ dependencies = [
|
||||
"windows 0.29.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-vibrancy"
|
||||
version = "0.0.0"
|
||||
source = "git+https://github.com/tauri-apps/tauri-plugin-vibrancy#b4fceab0d4a6d024f1b9916c126f10f513101128"
|
||||
dependencies = [
|
||||
"cocoa",
|
||||
"objc",
|
||||
"tauri",
|
||||
"windows 0.29.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "0.2.1"
|
||||
|
||||
@@ -22,6 +22,7 @@ serde = { version = "1.0", features = ["derive"] }
|
||||
# tauri = { git = "https://github.com/tauri-apps/tauri", rev = "5e0d59ec", features = ["api-all", "system-tray"] }
|
||||
tauri = { git = "https://github.com/tauri-apps/tauri", branch = "next", features = ["api-all", "system-tray", "updater"] }
|
||||
tauri-plugin-shadows = { git = "https://github.com/tauri-apps/tauri-plugin-shadows", features = ["tauri-impl"] }
|
||||
tauri-plugin-vibrancy = { git = "https://github.com/tauri-apps/tauri-plugin-vibrancy", features = ["tauri-impl"] }
|
||||
|
||||
reqwest = { version = "0.11", features = ["json"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
|
||||
@@ -9,6 +9,10 @@ pub struct VergeConfig {
|
||||
/// `light` or `dark`
|
||||
pub theme_mode: Option<String>,
|
||||
|
||||
/// enable blur mode
|
||||
/// maybe be able to set the alpha
|
||||
pub theme_blur: Option<bool>,
|
||||
|
||||
/// can the app auto startup
|
||||
pub enable_self_startup: Option<bool>,
|
||||
|
||||
@@ -157,6 +161,9 @@ impl Verge {
|
||||
if patch.theme_mode.is_some() {
|
||||
self.config.theme_mode = patch.theme_mode;
|
||||
}
|
||||
if patch.theme_blur.is_some() {
|
||||
self.config.theme_blur = patch.theme_blur;
|
||||
}
|
||||
|
||||
// should update system startup
|
||||
if patch.enable_self_startup.is_some() {
|
||||
|
||||
@@ -9,6 +9,15 @@ pub fn resolve_setup(app: &App) {
|
||||
let window = app.get_window("main").unwrap();
|
||||
window.set_shadow(true);
|
||||
|
||||
use tauri_plugin_vibrancy::Vibrancy;
|
||||
#[cfg(target_os = "windows")]
|
||||
window.apply_blur();
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
use tauri_plugin_vibrancy::MacOSVibrancy;
|
||||
window.apply_vibrancy(MacOSVibrancy::AppearanceBased);
|
||||
}
|
||||
|
||||
// setup a simple http server for singleton
|
||||
server::embed_server(&app.handle());
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
"resizable": true,
|
||||
"fullscreen": false,
|
||||
"decorations": false,
|
||||
"transparent": false,
|
||||
"transparent": true,
|
||||
"minWidth": 600,
|
||||
"minHeight": 520
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user