فهرست منبع

Center window on startup

Ruben 6 ماه پیش
والد
کامیت
80dfa9f0a3
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      src/PicView.Avalonia/StartUp/StartUpHelper.cs

+ 8 - 0
src/PicView.Avalonia/StartUp/StartUpHelper.cs

@@ -174,6 +174,10 @@ public static class StartUpHelper
             if (string.IsNullOrWhiteSpace(Settings.StartUp.LastFile))
             {
                 ErrorHandling.ShowStartUpMenu(vm);
+                if (Settings.WindowProperties.AutoFit)
+                {
+                    WindowFunctions.CenterWindowOnScreen();
+                }
             }
             else
             {
@@ -184,6 +188,10 @@ public static class StartUpHelper
         else
         {
             ErrorHandling.ShowStartUpMenu(vm);
+            if (Settings.WindowProperties.AutoFit)
+            {
+                WindowFunctions.CenterWindowOnScreen();
+            }
         }
     }