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
|
|
|
|
|
2017-05-16 11:50:30 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-03-16 13:49:23 +08:00
|
|
|
|
using OpenTK;
|
2017-03-28 20:03:34 +08:00
|
|
|
|
using osu.Framework.Testing;
|
2017-03-08 17:19:00 +08:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2017-03-16 08:11:50 +08:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2017-03-16 13:49:23 +08:00
|
|
|
|
using osu.Game.Screens.Select.Filter;
|
2017-03-08 17:19:00 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
|
|
|
|
{
|
|
|
|
|
public class TestCaseTabControl : TestCase
|
|
|
|
|
{
|
|
|
|
|
public override string Description => @"Filter for song select";
|
|
|
|
|
|
2017-07-07 20:05:55 +08:00
|
|
|
|
public TestCaseTabControl()
|
2017-03-08 17:19:00 +08:00
|
|
|
|
{
|
|
|
|
|
OsuSpriteText text;
|
2017-03-16 08:11:50 +08:00
|
|
|
|
OsuTabControl<GroupMode> filter;
|
2017-03-16 13:49:23 +08:00
|
|
|
|
Add(filter = new OsuTabControl<GroupMode>
|
|
|
|
|
{
|
2017-03-16 20:16:30 +08:00
|
|
|
|
Margin = new MarginPadding(4),
|
2017-03-16 15:43:42 +08:00
|
|
|
|
Size = new Vector2(229, 24),
|
2017-03-16 13:49:23 +08:00
|
|
|
|
AutoSort = true
|
|
|
|
|
});
|
|
|
|
|
Add(text = new OsuSpriteText
|
2017-03-08 17:19:00 +08:00
|
|
|
|
{
|
2017-03-16 13:49:23 +08:00
|
|
|
|
Text = "None",
|
|
|
|
|
Margin = new MarginPadding(4),
|
|
|
|
|
Position = new Vector2(275, 5)
|
2017-03-08 17:19:00 +08:00
|
|
|
|
});
|
2017-03-15 10:46:13 +08:00
|
|
|
|
|
2017-03-16 23:35:27 +08:00
|
|
|
|
filter.PinItem(GroupMode.All);
|
|
|
|
|
filter.PinItem(GroupMode.RecentlyPlayed);
|
2017-03-15 10:46:13 +08:00
|
|
|
|
|
2017-04-10 13:31:08 +08:00
|
|
|
|
filter.Current.ValueChanged += newFilter =>
|
2017-03-08 17:19:00 +08:00
|
|
|
|
{
|
2017-04-03 18:34:00 +08:00
|
|
|
|
text.Text = "Currently Selected: " + newFilter.ToString();
|
2017-03-08 17:19:00 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|