Skip to content

Commit 93c06b0

Browse files
committed
Remove tooltip when resetting zoom
1 parent dd0d3c0 commit 93c06b0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Diff for: src/PicView.Avalonia/UI/TooltipHelper.cs

+11
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,15 @@ internal static async Task ShowTooltipMessageAsync(object message, bool center =
8484
{
8585
await ShowTooltipMessageAsync(message, center, TimeSpan.FromSeconds(2));
8686
}
87+
88+
public static void StopTooltipMessage()
89+
{
90+
if (!_isRunning)
91+
{
92+
return;
93+
}
94+
_cancellationTokenSource?.Cancel();
95+
_isRunning = false;
96+
Dispatcher.UIThread.Invoke(() => UIHelper.GetToolTipMessage.IsVisible = false);
97+
}
8798
}

Diff for: src/PicView.Avalonia/Views/ImageViewer.axaml.cs

+1
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ public void ResetZoom(bool enableAnimations)
393393
}
394394
vm.ZoomValue = 1;
395395
vm.RotationAngle = 0;
396+
TooltipHelper.StopTooltipMessage();
396397
SetTitleHelper.SetTitle(vm);
397398
_isZoomed = false;
398399
}

0 commit comments

Comments
 (0)