2017-03-08 17:19:00 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
2017-03-15 11:30:42 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2017-03-08 17:19:00 +08:00
|
|
|
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Primitives;
|
|
|
|
|
using osu.Framework.Screens.Testing;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Screens.Select.Filter;
|
|
|
|
|
using osu.Game.Screens.Select.Tab;
|
|
|
|
|
|
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
|
|
|
|
{
|
|
|
|
|
public class TestCaseTabControl : TestCase
|
|
|
|
|
{
|
|
|
|
|
public override string Description => @"Filter for song select";
|
|
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
|
|
|
|
OsuSpriteText text;
|
|
|
|
|
FilterTabControl<GroupMode> filter;
|
|
|
|
|
|
|
|
|
|
Add(new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2017-03-15 10:46:13 +08:00
|
|
|
|
filter = new FilterTabControl<GroupMode>
|
2017-03-08 17:19:00 +08:00
|
|
|
|
{
|
|
|
|
|
Width = 229,
|
|
|
|
|
AutoSort = true
|
|
|
|
|
},
|
|
|
|
|
text = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = "None",
|
|
|
|
|
Margin = new MarginPadding(4)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2017-03-15 10:46:13 +08:00
|
|
|
|
|
|
|
|
|
filter.PinTab(GroupMode.All);
|
|
|
|
|
filter.PinTab(GroupMode.RecentlyPlayed);
|
|
|
|
|
|
2017-03-08 17:19:00 +08:00
|
|
|
|
filter.ValueChanged += (sender, mode) =>
|
|
|
|
|
{
|
|
|
|
|
Debug.WriteLine($"Selected {mode}");
|
|
|
|
|
text.Text = mode.ToString();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|