Преглед изворни кода

Fix possible crash when opening keybindings window on macOS

Ruben пре 3 месеци
родитељ
комит
02f38edf70
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      src/PicView.Avalonia/UI/GenericWindowHelper.cs

+ 5 - 1
src/PicView.Avalonia/UI/GenericWindowHelper.cs

@@ -24,7 +24,11 @@ public static class GenericWindowHelper
     {
         window.Loaded += delegate
         {
-            window.MinWidth = window.MaxWidth = window.Width;
+            if (!double.IsNaN(window.Width))
+            {
+                window.MinWidth = window.MaxWidth = window.Width;
+            }
+            
             window.Title = $"{TranslationManager.Translation.ApplicationShortcuts}  - PicView";
         };
         window.KeyUp += (_, e) =>