From 5ff3a15b1220dece22d20784aaa76b9b31c35733 Mon Sep 17 00:00:00 2001 From: Elias Bonnici Date: Tue, 16 Apr 2024 16:01:38 +0200 Subject: [PATCH] Change default window size --- lib/desktop/window_manager_helper/defaults.dart | 5 +++-- linux/my_application.cc | 4 ++-- macos/Runner/Base.lproj/MainMenu.xib | 4 ++-- windows/runner/main.cpp | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/desktop/window_manager_helper/defaults.dart b/lib/desktop/window_manager_helper/defaults.dart index 71c91743..c70dd676 100644 --- a/lib/desktop/window_manager_helper/defaults.dart +++ b/lib/desktop/window_manager_helper/defaults.dart @@ -18,6 +18,7 @@ import 'dart:ui'; class WindowDefaults { static const minWidth = 300.0; - static const minSize = Size(minWidth, 0.0); - static const bounds = Rect.fromLTWH(10.0, 10.0, 400.0, 720.0); + static const minHeight = 375.0; + static const minSize = Size(minWidth, minHeight); + static const bounds = Rect.fromLTWH(10.0, 10.0, 1100.0, 700.0); } diff --git a/linux/my_application.cc b/linux/my_application.cc index 3452446b..131bab63 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -47,9 +47,9 @@ static void my_application_activate(GApplication* application) { gtk_window_set_title(window, "Yubico Authenticator"); } - gtk_window_set_default_size(window, 320, 720); + gtk_window_set_default_size(window, 1100, 700); // Sets the minimum window size, should match desktop/window_manager_helper/defaults.dart - gtk_widget_set_size_request(GTK_WIDGET(window), 300, 0); + gtk_widget_set_size_request(GTK_WIDGET(window), 300, 375); gtk_widget_realize(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib index 304d2f28..089c7eae 100644 --- a/macos/Runner/Base.lproj/MainMenu.xib +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -62,10 +62,10 @@ - + - + diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 918361b1..718905c7 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -26,7 +26,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); - Win32Window::Size size(400, 720); + Win32Window::Size size(1100, 700); if (!window.Create(L"Yubico Authenticator", origin, size)) { return EXIT_FAILURE; }