From 828f9ef9c7129b9cac21122aa16706551ac5c67f Mon Sep 17 00:00:00 2001 From: Ruben Date: Thu, 2 Jan 2025 15:25:39 +0100 Subject: [PATCH] Update to determine if crop should be enabled and if to navigate or not --- src/PicView.Avalonia/Crop/CropFunctions.cs | 6 +++++- src/PicView.Avalonia/Navigation/NavigationHelper.cs | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/PicView.Avalonia/Crop/CropFunctions.cs b/src/PicView.Avalonia/Crop/CropFunctions.cs index 38f1b73d2..662126f59 100644 --- a/src/PicView.Avalonia/Crop/CropFunctions.cs +++ b/src/PicView.Avalonia/Crop/CropFunctions.cs @@ -69,7 +69,11 @@ public static bool DetermineIfShouldBeEnabled(MainViewModel vm) { return false; } - + + if (vm.IsEditableTitlebarOpen) + { + return false; + } return vm is { ScaleX: 1, RotationAngle: 0 }; } diff --git a/src/PicView.Avalonia/Navigation/NavigationHelper.cs b/src/PicView.Avalonia/Navigation/NavigationHelper.cs index 23467f625..f84af0ff2 100644 --- a/src/PicView.Avalonia/Navigation/NavigationHelper.cs +++ b/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 }