(i18n-ignore) docs: restore the window if it is minimized (#2823)

Co-authored-by: Tony <legendmastertony@gmail.com>
This commit is contained in:
阿菜 Cai
2025-08-04 23:22:23 +08:00
committed by GitHub
parent 7ac0c11ab5
commit 92996a2b82
7 changed files with 17 additions and 10 deletions

View File

@@ -1048,8 +1048,9 @@ tauri::Builder::default()
{
let app = tray.app_handle();
if let Some(webview_window) = app.get_webview_window("main") {
let _ = webview_window.show();
let _ = webview_window.set_focus();
let _ = webview_window.unminimize();
let _ = webview_window.show();
let _ = webview_window.set_focus();
}
}
})

View File

@@ -978,8 +978,9 @@ tauri::Builder::default()
{
let app = tray.app_handle();
if let Some(webview_window) = app.get_webview_window("main") {
let _ = webview_window.show();
let _ = webview_window.set_focus();
let _ = webview_window.unminimize();
let _ = webview_window.show();
let _ = webview_window.set_focus();
}
}
})

View File

@@ -1048,8 +1048,9 @@ tauri::Builder::default()
{
let app = tray.app_handle();
if let Some(webview_window) = app.get_webview_window("main") {
let _ = webview_window.show();
let _ = webview_window.set_focus();
let _ = webview_window.unminimize();
let _ = webview_window.show();
let _ = webview_window.set_focus();
}
}
})

View File

@@ -292,6 +292,7 @@ TrayIconBuilder::new()
// in this example, let's show and focus the main window when the tray is clicked
let app = tray.app_handle();
if let Some(window) = app.get_webview_window("main") {
let _ = window.unminimize();
let _ = window.show();
let _ = window.set_focus();
}

View File

@@ -1056,8 +1056,9 @@ tauri::Builder::default()
{
let app = tray.app_handle();
if let Some(webview_window) = app.get_webview_window("main") {
let _ = webview_window.show();
let _ = webview_window.set_focus();
let _ = webview_window.unminimize();
let _ = webview_window.show();
let _ = webview_window.set_focus();
}
}
})

View File

@@ -291,6 +291,7 @@ TrayIconBuilder::new()
// 在这个例子中,当点击托盘图标时,将展示并聚焦于主窗口
let app = tray.app_handle();
if let Some(window) = app.get_webview_window("main") {
let _ = window.unminimize();
let _ = window.show();
let _ = window.set_focus();
}

View File

@@ -1049,8 +1049,9 @@ tauri::Builder::default()
{
let app = tray.app_handle();
if let Some(webview_window) = app.get_webview_window("main") {
let _ = webview_window.show();
let _ = webview_window.set_focus();
let _ = webview_window.unminimize();
let _ = webview_window.show();
let _ = webview_window.set_focus();
}
}
})