mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 04:49:40 +08:00
58 lines
1.8 KiB
C#
58 lines
1.8 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 System;
|
|||
|
using System.Collections.Generic;
|
|||
|
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.Home.Friends;
|
|||
|
using osuTK;
|
|||
|
|
|||
|
namespace osu.Game.Tests.Visual.UserInterface
|
|||
|
{
|
|||
|
public class TestSceneUserListToolbar : OsuTestScene
|
|||
|
{
|
|||
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|||
|
{
|
|||
|
typeof(UserSortTabControl),
|
|||
|
typeof(OverlaySortTabControl<>),
|
|||
|
typeof(OverlayPanelDisplayStyleControl),
|
|||
|
typeof(UserListToolbar),
|
|||
|
};
|
|||
|
|
|||
|
[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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|