diff --git a/src/GWallet.Frontend.Maui/App.xaml.fs b/src/GWallet.Frontend.Maui/App.xaml.fs index d70ec4cc3..c2cb851e1 100644 --- a/src/GWallet.Frontend.Maui/App.xaml.fs +++ b/src/GWallet.Frontend.Maui/App.xaml.fs @@ -1,5 +1,6 @@ namespace GWallet.Frontend.Maui +open Microsoft.Maui open Microsoft.Maui.Controls open Microsoft.Maui.Controls.Xaml @@ -9,3 +10,13 @@ type App() as this = do this.LoadFromXaml typeof |> ignore do this.MainPage <- (WelcomePage GlobalState) :> Page + +#if GTK + override _.CreateWindow(activationState) = + let window = base.CreateWindow(activationState) + window.Created.Add(fun _ -> + let gtkWindow = MauiGtkApplication.Current.MainWindow + gtkWindow.Resize FrontendHelpers.DefaultDesktopWindowSize + ) + window +#endif diff --git a/src/GWallet.Frontend.XF.Gtk/Program.fs b/src/GWallet.Frontend.XF.Gtk/Program.fs index 9832eab91..112838eab 100644 --- a/src/GWallet.Frontend.XF.Gtk/Program.fs +++ b/src/GWallet.Frontend.XF.Gtk/Program.fs @@ -7,6 +7,7 @@ open Xamarin.Forms.Platform.GTK open GWallet.Backend open GWallet.Backend.FSharpUtil.UwpHacks +open GWallet.Frontend.XF module Main = @@ -34,7 +35,7 @@ module Main = ) else window.SetApplicationIcon logoFileName - window.SetDefaultSize (500, 1000) + window.SetDefaultSize FrontendHelpers.DefaultDesktopWindowSize window.Show() Gtk.Application.Run() 0 diff --git a/src/GWallet.Frontend.XF/FrontendHelpers.fs b/src/GWallet.Frontend.XF/FrontendHelpers.fs index 092ee2426..85e643f6a 100644 --- a/src/GWallet.Frontend.XF/FrontendHelpers.fs +++ b/src/GWallet.Frontend.XF/FrontendHelpers.fs @@ -464,3 +464,4 @@ module FrontendHelpers = let currencyLogoImg = Image(Source = imageSource, IsVisible = true) currencyLogoImg #endif + let DefaultDesktopWindowSize = 500, 1000