Skip to content

Commit

Permalink
Account for taskbar size when resizing to DS
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Jan 21, 2024
1 parent 6b83eab commit 92c0b0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void main() async {
await FieldImages.loadFields('assets/fields/');

Display primaryDisplay = await screenRetriever.getPrimaryDisplay();
Size screenSize =
primaryDisplay.size * (primaryDisplay.scaleFactor?.toDouble() ?? 1.0);
Size screenSize = (primaryDisplay.visibleSize ?? primaryDisplay.size) *
(primaryDisplay.scaleFactor?.toDouble() ?? 1.0);

await windowManager.setMinimumSize(screenSize * 0.60);
await windowManager.setTitleBarStyle(TitleBarStyle.hidden,
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,8 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {
void _onDriverStationDocked() async {
Display primaryDisplay = await screenRetriever.getPrimaryDisplay();
double pixelRatio = primaryDisplay.scaleFactor?.toDouble() ?? 1.0;
Size screenSize = primaryDisplay.size * pixelRatio;
Size screenSize =
(primaryDisplay.visibleSize ?? primaryDisplay.size) * pixelRatio;

await windowManager.unmaximize();

Expand Down

0 comments on commit 92c0b0b

Please sign in to comment.