Skip to content

Commit

Permalink
chore: Add windowButtonVisibility to WindowOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Apr 8, 2023
1 parent 1b58a34 commit a6af58e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void main() async {
backgroundColor: Colors.transparent,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.hidden,
windowButtonVisibility: false,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
Expand Down
5 changes: 4 additions & 1 deletion lib/src/window_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions lib/src/window_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class WindowOptions {
this.skipTaskbar,
this.title,
this.titleBarStyle,
this.windowButtonVisibility,
});

final Size? size;
Expand All @@ -27,4 +28,5 @@ class WindowOptions {
final bool? skipTaskbar;
final String? title;
final TitleBarStyle? titleBarStyle;
final bool? windowButtonVisibility;
}

0 comments on commit a6af58e

Please sign in to comment.