Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: restore the window if it is minimized #2823

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/content/docs/es/start/migrate/from-tauri-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,9 @@ tauri::Builder::default()
if event.click_type == ClickType::Left {
let app = tray.app_handle();
if let Some(webview_window) = app.get_webview_window("main") {
let _ = webview_window.show();
let _ = webview_window.set_focus();
window.unminimize().unwrap(); // Restore the window if it is minimized
window.show().unwrap();
window.set_focus().unwrap();
}
}
})
Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/fr/start/migrate/from-tauri-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
window.unminimize().unwrap(); // Restore the window if it is minimized
window.show().unwrap();
window.set_focus().unwrap();
}
}
})
Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/plugin/system-tray.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,9 @@ 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.show();
let _ = window.set_focus();
window.unminimize().unwrap(); // Restore the window if it is minimized
window.show().unwrap();
window.set_focus().unwrap();
}
}
_ => {
Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/start/migrate/from-tauri-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,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();
window.unminimize().unwrap(); // Restore the window if it is minimized
window.show().unwrap();
window.set_focus().unwrap();
}
}
})
Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/zh-cn/start/migrate/from-tauri-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,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();
window.unminimize().unwrap(); // 恢复窗口 如果它被最小化
window.show().unwrap();
window.set_focus().unwrap();
}
}
})
Expand Down
Loading