From e6fc124554fb9e3d76c9a9ebd7d5fc673c59f29f Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sun, 8 Jan 2023 13:10:30 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=8F=8C=E5=87=BB=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E6=94=AF=E6=8C=81=E6=94=BE=E5=A4=A7=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E7=AA=97=E5=8F=A3=E8=80=8C=E9=9D=9E=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index d029c0d..e0b47ba 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -126,11 +126,8 @@ fn main() -> wry::Result<()> { if req == "drag_window" { let _ = window.drag_window(); } else if req == "fullscreen" { - if window.fullscreen().is_some() { - window.set_fullscreen(None); - } else { - window.set_fullscreen(Some(Fullscreen::Borderless(None))); - } + let is_maximized = window.is_maximized(); + window.set_maximized(!is_maximized); } else if req.starts_with("open_browser") { let href = req.replace("open_browser:", ""); webbrowser::open(&href).expect("no browser");