1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Don't play fling animation when activating a notification

This commit is contained in:
Dean Herbert 2022-09-12 18:57:18 +09:00
parent c064853751
commit 4ee3e8f087
3 changed files with 7 additions and 7 deletions

View File

@ -227,7 +227,7 @@ namespace osu.Game.Overlays.Notifications
if (e.Button == MouseButton.Left) if (e.Button == MouseButton.Left)
Activated?.Invoke(); Activated?.Invoke();
Close(true); Close(false);
return true; return true;
} }
@ -245,13 +245,13 @@ namespace osu.Game.Overlays.Notifications
public bool WasClosed; public bool WasClosed;
public virtual void Close(bool userTriggered) public virtual void Close(bool runFlingAnimation)
{ {
if (WasClosed) return; if (WasClosed) return;
WasClosed = true; WasClosed = true;
if (userTriggered && dragContainer.FlingLeft()) if (runFlingAnimation && dragContainer.FlingLeft())
this.FadeOut(600, Easing.In); this.FadeOut(600, Easing.In);
else else
{ {

View File

@ -235,12 +235,12 @@ namespace osu.Game.Overlays.Notifications
}); });
} }
public override void Close(bool userTriggered) public override void Close(bool runFlingAnimation)
{ {
switch (State) switch (State)
{ {
case ProgressNotificationState.Cancelled: case ProgressNotificationState.Cancelled:
base.Close(userTriggered); base.Close(runFlingAnimation);
break; break;
case ProgressNotificationState.Active: case ProgressNotificationState.Active:

View File

@ -148,7 +148,7 @@ namespace osu.Game.Updater
StartDownload(); StartDownload();
} }
public override void Close(bool userTriggered) public override void Close(bool runFlingAnimation)
{ {
// cancelling updates is not currently supported by the underlying updater. // cancelling updates is not currently supported by the underlying updater.
// only allow dismissing for now. // only allow dismissing for now.
@ -156,7 +156,7 @@ namespace osu.Game.Updater
switch (State) switch (State)
{ {
case ProgressNotificationState.Cancelled: case ProgressNotificationState.Cancelled:
base.Close(userTriggered); base.Close(runFlingAnimation);
break; break;
} }
} }