Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DS Height Resizing #213

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions lib/pages/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1712,15 +1712,11 @@ 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.visibleSize ?? primaryDisplay.size) * pixelRatio;
Size screenSize = primaryDisplay.visibleSize ?? primaryDisplay.size;

await windowManager.unmaximize();

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

await windowManager.setSize(newScreenSize);

Expand All @@ -1739,8 +1735,10 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {
await windowManager.setResizable(true);

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

void _showWindowCloseConfirmation(BuildContext context) {
Expand Down