Browse Source

Update to determine if crop should be enabled and if to navigate or not

Ruben 9 months ago
parent
commit
828f9ef9c7

+ 5 - 1
src/PicView.Avalonia/Crop/CropFunctions.cs

@@ -69,7 +69,11 @@ public static class CropFunctions
         {
             return false;
         }
-        
+
+        if (vm.IsEditableTitlebarOpen)
+        {
+            return false;
+        }
         
         return vm is { ScaleX: 1, RotationAngle: 0 };
     }

+ 2 - 1
src/PicView.Avalonia/Navigation/NavigationHelper.cs

@@ -36,7 +36,8 @@ public static class NavigationHelper
     public static bool CanNavigate(MainViewModel vm)
     {
         return vm?.ImageIterator?.ImagePaths is not null &&
-               vm.ImageIterator.ImagePaths.Count > 0 && !CropFunctions.IsCropping && !UIHelper.IsDialogOpen;
+               vm.ImageIterator.ImagePaths.Count > 0 && !CropFunctions.IsCropping &&
+               !UIHelper.IsDialogOpen && !vm.IsEditableTitlebarOpen;
         // TODO: should probably turn this into CanExecute observable for ReactiveUI
     }