Skip to content

Commit

Permalink
Update to determine if crop should be enabled and if to navigate or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Jan 2, 2025
1 parent 5186943 commit 828f9ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/PicView.Avalonia/Crop/CropFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ public static bool DetermineIfShouldBeEnabled(MainViewModel vm)
{
return false;
}


if (vm.IsEditableTitlebarOpen)
{
return false;
}

return vm is { ScaleX: 1, RotationAngle: 0 };
}
Expand Down
3 changes: 2 additions & 1 deletion src/PicView.Avalonia/Navigation/NavigationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 828f9ef

Please sign in to comment.