Skip to content

Commit

Permalink
Set a maximum value for minimum window size for high-res screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Jan 21, 2024
1 parent 92c0b0b commit a4b1c59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';
import 'dart:math';

import 'package:flutter/material.dart';

Expand Down Expand Up @@ -81,7 +82,10 @@ void main() async {
Size screenSize = (primaryDisplay.visibleSize ?? primaryDisplay.size) *
(primaryDisplay.scaleFactor?.toDouble() ?? 1.0);

await windowManager.setMinimumSize(screenSize * 0.60);
double minimumSizeWidth = min(screenSize.width * 0.60, 1280.0);
double minimumSizeHeight = min(screenSize.height * 0.60, 720.0);

await windowManager.setMinimumSize(Size(minimumSizeWidth, minimumSizeHeight));
await windowManager.setTitleBarStyle(TitleBarStyle.hidden,
windowButtonVisibility: false);

Expand Down

0 comments on commit a4b1c59

Please sign in to comment.