1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 15:23:14 +08:00

Dismiss popovers on returning to lounge

This commit is contained in:
Dean Herbert 2021-07-12 18:54:17 +09:00
parent c5319c06c2
commit 4dea2d9778
2 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,7 @@ using System.Collections.Specialized;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -244,5 +245,11 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
if (roomManager != null)
roomManager.RoomsUpdated -= updateSorting;
}
public void HideAnyPopovers()
{
// must be called on a child of the PopoverContainer due to parent traversal not considering self.
roomFlow.HidePopover();
}
}
}

View File

@ -46,10 +46,11 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
[CanBeNull]
private IDisposable joiningRoomOperation { get; set; }
private RoomsContainer roomsContainer;
[BackgroundDependencyLoader]
private void load()
{
RoomsContainer roomsContainer;
OsuScrollContainer scrollContainer;
InternalChildren = new Drawable[]
@ -165,6 +166,9 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
{
base.OnSuspending(next);
filter.HoldFocus = false;
// ensure any password prompt is dismissed.
roomsContainer.HideAnyPopovers();
}
public void Join(Room room, string password)