style(ui): redesign app layout to native macOS density and refine visual theme

- Adjusted overall layout scale to perfectly match original native macOS density.

- Refined sidebar into a floating rounded slab with proper padding, border, and toggle button placement.

- Fixed drag region overlap preventing button interactions in the title bar.

- Removed artificial shadow lines and scrollbars from the sidebar.

- Updated Tauri backend configuration, dependencies, and scheduler functions for improved stability.
This commit is contained in:
NimBold
2026-06-14 08:36:53 +03:30
parent 4ec1c4fdf6
commit 796d00d527
12 changed files with 941 additions and 597 deletions
+17 -1
View File
@@ -4402,7 +4402,7 @@ dependencies = [
"url",
"webkit2gtk",
"webview2-com",
"window-vibrancy",
"window-vibrancy 0.6.0",
"windows 0.61.3",
]
@@ -4440,6 +4440,7 @@ dependencies = [
"tokio",
"tokio-tungstenite",
"tower-http",
"window-vibrancy 0.7.1",
]
[[package]]
@@ -5683,6 +5684,21 @@ dependencies = [
"windows-version",
]
[[package]]
name = "window-vibrancy"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "010797bd7c40396fbc59d3105089fed0885fe267a0ef4a0a4646df54e28647f6"
dependencies = [
"objc2",
"objc2-app-kit",
"objc2-core-foundation",
"objc2-foundation",
"raw-window-handle",
"windows-sys 0.60.2",
"windows-version",
]
[[package]]
name = "windows"
version = "0.61.3"
+2 -1
View File
@@ -18,7 +18,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = ["tray-icon", "image-png"] }
tauri = { version = "2", features = ["macos-private-api", "tray-icon", "image-png"] }
tauri-plugin-opener = "2"
tauri-plugin-dialog = "2"
serde = { version = "1", features = ["derive"] }
@@ -47,3 +47,4 @@ rusqlite = { version = "0.40.1", features = ["bundled"] }
chrono = "0.4.38"
cocoa = "0.25"
objc = "0.2.7"
window-vibrancy = "0.7.1"
+12 -2
View File
@@ -714,7 +714,7 @@ pub(crate) async fn start_media_download_internal(
let spd_re = Regex::new(r"at\s+([^\s]+)").unwrap();
let eta_re = Regex::new(r"ETA\s+([^\s]+)").unwrap();
tokio::spawn(async move {
tauri::async_runtime::spawn(async move {
let _keep_alive = config_path; // Keep the temp file alive
let mut reader = BufReader::new(stdout).lines();
let mut current_track: f64 = 0.0;
@@ -1207,6 +1207,16 @@ pub fn run() {
crate::scheduler::spawn_scheduler(app.handle().clone());
#[cfg(target_os = "macos")]
{
use tauri::Manager;
use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial};
if let Some(window) = app.get_webview_window("main") {
apply_vibrancy(&window, NSVisualEffectMaterial::Sidebar, None, None)
.expect("Unsupported platform! 'apply_vibrancy' is only supported on macOS");
}
}
let resource_dir = app.path().resource_dir().unwrap();
let aria2c_path = resource_dir.join("binaries").join("aria2c");
@@ -1233,7 +1243,7 @@ pub fn run() {
let app_handle_clone = app.handle().clone();
let aria2_port_clone = aria2_port;
let aria2_secret_clone = aria2_secret.clone();
tokio::spawn(async move {
tauri::async_runtime::spawn(async move {
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
let ws_url = format!("ws://127.0.0.1:{}/jsonrpc", aria2_port_clone);
+1 -1
View File
@@ -20,7 +20,7 @@ struct SchedulerSettings {
}
pub fn spawn_scheduler(app_handle: tauri::AppHandle) {
tokio::spawn(async move {
tauri::async_runtime::spawn(async move {
let mut interval = tokio::time::interval(Duration::from_secs(10));
loop {
interval.tick().await;
+4 -2
View File
@@ -18,12 +18,14 @@
"minWidth": 800,
"minHeight": 600,
"titleBarStyle": "Overlay",
"hiddenTitle": true
"hiddenTitle": true,
"transparent": true
}
],
"security": {
"csp": null
}
},
"macOSPrivateApi": true
},
"bundle": {
"active": true,