Skip to content

Commit

Permalink
Enable crop in contextmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Jan 2, 2025
1 parent d7264eb commit ca03546
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PicView.Avalonia/Views/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@
Command="{CompiledBinding CropCommand}"
Header="{CompiledBinding Crop,
Mode=OneWay}"
IsEnabled="False">
x:Name="CropMenuItem">
<MenuItem.Icon>
<Path
Data="{StaticResource CropGeometry}"
Expand Down
2 changes: 2 additions & 0 deletions src/PicView.Avalonia/Views/MainView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ private void OnMainContextMenuOpened(object? sender, EventArgs e)
return;
}

CropMenuItem.IsEnabled = CropFunctions.DetermineIfShouldBeEnabled(vm);

// Set source for ChangeCtrlZoomImage
// TODO should probably be refactored inside a command (It doesn't update the UI in the zoom view, so should be made into a command)
if (!Application.Current.TryGetResource("ScanEyeImage", Application.Current.RequestedThemeVariant, out var scanEyeImage ))
Expand Down

0 comments on commit ca03546

Please sign in to comment.