1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 20:24:01 +08:00
Files
osu-lazer/osu.Game.Tests/Visual/UserInterface/TestSceneUserListToolbar.cs
T
Dean Herbert c570db6c40 Add ability to search for users (#37225)
This was a private request for roundtable event usage. It’s also a
common feature request, so I decided to spend a bit of time getting this
working well-enough.


https://github.com/user-attachments/assets/acceb57f-2979-43d0-9fc2-33e977bd2dd5


---

### Delay loading spinner / loading layer initial load briefly to avoid
flickering

There's cases in this overlay where loading takes a few milliseconds.
The loading spinner gets annoying. This also happens elsewhere, so this
could be considered a global fix. Separate PR? probably...

### Ingest loading state of dashboard child content to show more correct
loading layer

Each display had their own loading layer implementation, but this is
already too deep (inside the scroll content) and doesn't display great
when for instance, results don't take up the full screen height.

---------

Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2026-04-07 14:14:49 +02:00

48 lines
1.5 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osu.Game.Overlays.Dashboard.Friends;
using osuTK;
namespace osu.Game.Tests.Visual.UserInterface
{
public partial class TestSceneUserListToolbar : OsuTestScene
{
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
public TestSceneUserListToolbar()
{
UserListToolbar toolbar;
OsuSpriteText sort;
OsuSpriteText displayStyle;
Add(toolbar = new UserListToolbar
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
});
Add(new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
Children = new Drawable[]
{
sort = new OsuSpriteText(),
displayStyle = new OsuSpriteText()
}
});
toolbar.SortCriteria.BindValueChanged(criteria => sort.Text = $"Criteria: {criteria.NewValue}", true);
toolbar.DisplayStyle.BindValueChanged(style => displayStyle.Text = $"Style: {style.NewValue}", true);
}
}
}