Skip to content

Commit

Permalink
Make window frameless when docked above Driver Station
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Dec 5, 2023
1 parent 23874e0 commit 536077d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/pages/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -895,9 +895,9 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {

await windowManager.unmaximize();

Size newScreenSize = Size(screenSize.width + 16,
(screenSize.height + 8) - (200 * pixelRatio)) /
pixelRatio;
Size newScreenSize =
Size(screenSize.width, (screenSize.height) - (200 * pixelRatio)) /
pixelRatio;

await windowManager.setSize(newScreenSize);

Expand All @@ -906,12 +906,18 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {
Globals.isWindowMaximizable = false;
Globals.isWindowDraggable = false;
await windowManager.setResizable(false);

await windowManager.setAsFrameless();
}

void _onDriverStationUndocked() async {
Globals.isWindowMaximizable = true;
Globals.isWindowDraggable = true;
await windowManager.setResizable(true);

// Re-adds the window frame, window manager's API for this is weird
await windowManager.setTitleBarStyle(TitleBarStyle.hidden,
windowButtonVisibility: false);
}

void showWindowCloseConfirmation(BuildContext context) {
Expand Down

0 comments on commit 536077d

Please sign in to comment.