mirror of
https://github.com/ayangweb/BongoCat.git
synced 2026-03-12 17:51:48 +08:00
feat: 在 macOS 上,支持应用运行时通过启动台再次点击打开偏好设置 (#207)
This commit is contained in:
@@ -9,7 +9,7 @@ use tauri_plugin_custom_window::{
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
let app = tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
let app_handle = app.handle();
|
||||
|
||||
@@ -50,6 +50,16 @@ pub fn run() {
|
||||
}
|
||||
_ => {}
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.build(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
||||
app.run(|app_handle, event| match event {
|
||||
#[cfg(target_os = "macos")]
|
||||
tauri::RunEvent::Reopen { .. } => {
|
||||
tauri_plugin_custom_window::show_preference_window(app_handle);
|
||||
}
|
||||
_ => {
|
||||
let _ = app_handle;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user