Skip to content

Commit

Permalink
fix: Sub Windows are allowed to be smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Dec 31, 2024
1 parent 63a4448 commit 06c8a4b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/utils/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ import 'package:provider/provider.dart';
import 'package:unity_multi_window/unity_multi_window.dart';
import 'package:window_manager/window_manager.dart';

/// The small window size.
///
/// This is used in debug mode and when the window is a sub window.
const kSmallWindowSize = Size(300, 200);

/// The initial size of the window
const kInitialWindowSize = Size(1066, 645);

Expand All @@ -56,7 +61,11 @@ Future<void> configureWindow({bool? fullscreen}) async {
await WindowManager.instance.ensureInitialized();
await windowManager.waitUntilReadyToShow(
WindowOptions(
minimumSize: kDebugMode ? Size(100, 100) : kInitialWindowSize,
minimumSize: () {
if (kDebugMode) return kSmallWindowSize;
if (isSubWindow) return kSmallWindowSize;
return kInitialWindowSize;
}(),
skipTaskbar: false,
titleBarStyle: TitleBarStyle.hidden,
windowButtonVisibility: true,
Expand Down

0 comments on commit 06c8a4b

Please sign in to comment.