From a6af58e570ad812b07249f6848c7544b6f50fab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=81=A5=E8=8E=B9?= Date: Sat, 8 Apr 2023 18:39:49 +0800 Subject: [PATCH] chore: Add windowButtonVisibility to WindowOptions --- example/lib/main.dart | 1 + lib/src/window_manager.dart | 5 ++++- lib/src/window_options.dart | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 23d677cf..1f18072b 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -16,6 +16,7 @@ void main() async { backgroundColor: Colors.transparent, skipTaskbar: false, titleBarStyle: TitleBarStyle.hidden, + windowButtonVisibility: false, ); windowManager.waitUntilReadyToShow(windowOptions, () async { await windowManager.show(); diff --git a/lib/src/window_manager.dart b/lib/src/window_manager.dart index b75e7b95..18596e23 100644 --- a/lib/src/window_manager.dart +++ b/lib/src/window_manager.dart @@ -126,7 +126,10 @@ class WindowManager { } if (options?.title != null) await setTitle(options!.title!); if (options?.titleBarStyle != null) { - await setTitleBarStyle(options!.titleBarStyle!); + await setTitleBarStyle( + options!.titleBarStyle!, + windowButtonVisibility: options.windowButtonVisibility ?? true, + ); } if (callback != null) { diff --git a/lib/src/window_options.dart b/lib/src/window_options.dart index df19a4f4..1fd6e61c 100644 --- a/lib/src/window_options.dart +++ b/lib/src/window_options.dart @@ -15,6 +15,7 @@ class WindowOptions { this.skipTaskbar, this.title, this.titleBarStyle, + this.windowButtonVisibility, }); final Size? size; @@ -27,4 +28,5 @@ class WindowOptions { final bool? skipTaskbar; final String? title; final TitleBarStyle? titleBarStyle; + final bool? windowButtonVisibility; }