Skip to content

Commit

Permalink
Add RemoveEffects to ClearEffects button
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Jan 21, 2025
1 parent 4d78355 commit cf16999
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/PicView.Avalonia.Win32/Views/EffectsWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
Focusable="True"
Margin="0"
Padding="10,2,5,10"
PointerPressed="MoveWindow" />
PointerPressed="MoveWindow"
x:Name="EffectsView" />
</StackPanel>
</Border>
</Window>
6 changes: 6 additions & 0 deletions src/PicView.Avalonia.Win32/Views/EffectsWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using PicView.Avalonia.ViewModels;
using PicView.Avalonia.WindowBehavior;
using PicView.Core.Config;
using PicView.Core.Localization;
Expand Down Expand Up @@ -50,6 +51,11 @@ public EffectsWindow()
MinWidth = MaxWidth = Width;
Title = $"{TranslationHelper.Translation.Effects} - PicView";

ClearEffectsItem.Click += delegate
{
EffectsView?.RemoveEffects(DataContext as MainViewModel);
};

ClientSizeProperty.Changed.Subscribe(size =>
{
WindowResizing.HandleWindowResize(this, size);
Expand Down
2 changes: 1 addition & 1 deletion src/PicView.Avalonia/Views/EffectsView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private async Task ApplyEffectsDebounced()
await ImageEffectsHelper.ApplyEffects(vm, vm.EffectConfig, _cancellationTokenSource.Token).ConfigureAwait(false);
}

private async Task RemoveEffects(MainViewModel vm)
public async Task RemoveEffects(MainViewModel vm)
{
_reloading = true;
try
Expand Down

0 comments on commit cf16999

Please sign in to comment.