Explorar el Código

Fix macOS-specific issues: improve window centering, prevent thumbnail crash, and disable resizing in KeybindingsWindow

Ruben hace 2 meses
padre
commit
9b4582d0b4

+ 1 - 0
src/PicView.Avalonia.MacOS/Views/KeybindingsWindow.axaml

@@ -1,4 +1,5 @@
 <Window
+    CanResize="False"
     ExtendClientAreaChromeHints="SystemChrome"
     ExtendClientAreaTitleBarHeightHint="-1"
     SizeToContent="WidthAndHeight"

+ 4 - 0
src/PicView.Avalonia/ImageHandling/GetThumbnails.cs

@@ -14,6 +14,10 @@ public static class GetThumbnails
         {
             if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
             {
+                if (fileInfo is null || !fileInfo.Exists)
+                {
+                    return null;
+                }
                 await using var stream = FileStreamUtils.GetOptimizedFileStream(fileInfo);
                 var thumb = Bitmap.DecodeToHeight(stream, (int)height);
                 return thumb;

+ 1 - 1
src/PicView.Avalonia/StartUp/QuickLoad.cs

@@ -125,7 +125,7 @@ public static class QuickLoad
             }, DispatcherPriority.Send);
             if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
             {
-                Dispatcher.UIThread.Post(() => WindowFunctions.CenterWindowOnScreen(), DispatcherPriority.Render);
+                Dispatcher.UIThread.Post(() => WindowFunctions.CenterWindowOnScreen(), DispatcherPriority.Send);
             }
         }
         else