mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
feat: custom window decorations
This commit is contained in:
@@ -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