mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 19:45:43 +08:00
Fix progress notifications being able to be flung
This commit is contained in:
parent
82d4689716
commit
b6dd8168d2
@ -68,6 +68,8 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public virtual bool Read { get; set; }
|
public virtual bool Read { get; set; }
|
||||||
|
|
||||||
|
protected virtual bool AllowFlingDismiss => true;
|
||||||
|
|
||||||
public new bool IsDragged => dragContainer.IsDragged;
|
public new bool IsDragged => dragContainer.IsDragged;
|
||||||
|
|
||||||
protected virtual IconUsage CloseButtonIcon => FontAwesome.Solid.Check;
|
protected virtual IconUsage CloseButtonIcon => FontAwesome.Solid.Check;
|
||||||
@ -315,7 +317,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
protected override void OnDragEnd(DragEndEvent e)
|
protected override void OnDragEnd(DragEndEvent e)
|
||||||
{
|
{
|
||||||
if (Rotation < -10 || velocity.X < -0.3f)
|
if (notification.AllowFlingDismiss && (Rotation < -10 || velocity.X < -0.3f))
|
||||||
notification.Close(true);
|
notification.Close(true);
|
||||||
else if (X > 30 || velocity.X > 0.3f)
|
else if (X > 30 || velocity.X > 0.3f)
|
||||||
notification.ForwardToOverlay?.Invoke();
|
notification.ForwardToOverlay?.Invoke();
|
||||||
|
@ -25,6 +25,8 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public Func<bool>? CancelRequested { get; set; }
|
public Func<bool>? CancelRequested { get; set; }
|
||||||
|
|
||||||
|
protected override bool AllowFlingDismiss => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The function to post completion notifications back to.
|
/// The function to post completion notifications back to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user