mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Disallow flinging when not in toast state
This commit is contained in:
@ -158,7 +158,10 @@ namespace osu.Game.Overlays
|
|||||||
playDebouncedSample(notification.PopInSampleName);
|
playDebouncedSample(notification.PopInSampleName);
|
||||||
|
|
||||||
if (State.Value == Visibility.Hidden)
|
if (State.Value == Visibility.Hidden)
|
||||||
|
{
|
||||||
|
notification.IsInTray = true;
|
||||||
toastTray.Post(notification);
|
toastTray.Post(notification);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
addPermanently(notification);
|
addPermanently(notification);
|
||||||
|
|
||||||
@ -167,6 +170,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private void addPermanently(Notification notification)
|
private void addPermanently(Notification notification)
|
||||||
{
|
{
|
||||||
|
notification.IsInTray = false;
|
||||||
|
|
||||||
var ourType = notification.GetType();
|
var ourType = notification.GetType();
|
||||||
int depth = notification.DisplayOnTop ? -runningDepth : runningDepth;
|
int depth = notification.DisplayOnTop ? -runningDepth : runningDepth;
|
||||||
|
|
||||||
|
@ -68,6 +68,11 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this notification is in the <see cref="NotificationOverlayToastTray"/>.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsInTray { get; set; }
|
||||||
|
|
||||||
private readonly Box initialFlash;
|
private readonly Box initialFlash;
|
||||||
|
|
||||||
private Box background = null!;
|
private Box background = null!;
|
||||||
@ -262,7 +267,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnDragStart(DragStartEvent e) => true;
|
protected override bool OnDragStart(DragStartEvent e) => notification.IsInTray;
|
||||||
|
|
||||||
protected override void OnDrag(DragEvent e)
|
protected override void OnDrag(DragEvent e)
|
||||||
{
|
{
|
||||||
@ -326,7 +331,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public bool FlingLeft()
|
public bool FlingLeft()
|
||||||
{
|
{
|
||||||
if (this.FindClosestParent<NotificationOverlayToastTray>() == null)
|
if (!notification.IsInTray)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (flinging)
|
if (flinging)
|
||||||
|
Reference in New Issue
Block a user