mirror of
https://github.com/CrazyJasonwell/clash-verge-rev.git
synced 2026-10-19 21:45:41 +08:00
feat: custom window decorations
This commit is contained in:
1 parent
2d2899b68a
commit
ed6bfa5fa2
10 files changed
+194
-648
No files matched your search
+23
-1
@@ -8,7 +8,7 @@ use crate::{
|
||||
},
|
||||
};
|
||||
use serde_yaml::Mapping;
|
||||
use tauri::State;
|
||||
use tauri::{AppHandle, Manager, State};
|
||||
|
||||
/// get all profiles from `profiles.yaml`
|
||||
/// do not acquire the lock of ProfileLock
|
||||
@@ -246,3 +246,25 @@ pub async fn patch_verge_config(
|
||||
|
||||
verge.config.save_file()
|
||||
}
|
||||
|
||||
/// start dragging window
|
||||
#[tauri::command]
|
||||
pub fn win_drag(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("main").unwrap();
|
||||
window.start_dragging().unwrap();
|
||||
}
|
||||
|
||||
/// hide the window
|
||||
#[tauri::command]
|
||||
pub fn win_hide(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("main").unwrap();
|
||||
window.hide().unwrap();
|
||||
}
|
||||
|
||||
/// mini the window
|
||||
#[tauri::command]
|
||||
pub fn win_mini(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("main").unwrap();
|
||||
// todo: these methods still has bug on Windows
|
||||
window.minimize().unwrap();
|
||||
}
|
||||
Reference in new issue
Block a user