1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-16 12:12:56 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseTextBadgePair.cs

58 lines
1.9 KiB
C#
Raw Normal View History

2019-05-13 16:14:52 +08:00
// 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.
2018-07-24 10:04:18 +08:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
2018-07-24 10:04:18 +08:00
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Overlays.Changelog.Header;
2019-05-12 23:36:05 +08:00
using osuTK.Graphics;
2018-07-24 10:04:18 +08:00
namespace osu.Game.Tests.Visual
{
public class TestCaseTextBadgePair : OsuTestCase
{
public TestCaseTextBadgePair()
{
Breadcrumb breadcrumb;
2018-07-24 10:04:18 +08:00
2018-07-24 23:02:24 +08:00
Add(new Container
2018-07-24 10:04:18 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 250,
Height = 50,
Children = new Drawable[]
{
new Box
{
Colour = Color4.Gray,
Alpha = 0.5f,
RelativeSizeAxes = Axes.Both,
},
breadcrumb = new TestBadgePair(Color4.DeepSkyBlue, "Test")
2018-07-24 10:04:18 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
}
}
});
AddStep(@"Deactivate", breadcrumb.Deactivate);
AddStep(@"Activate", breadcrumb.Activate);
AddStep(@"Hide text", () => breadcrumb.HideText(200));
AddStep(@"Show text", () => breadcrumb.ShowText(200));
AddStep(@"Different text", () => breadcrumb.ShowText(200, "This one's a little bit wider"));
AddStep(@"Different text", () => breadcrumb.ShowText(200, "Ok?.."));
}
private class TestBadgePair : Breadcrumb
{
public TestBadgePair(ColourInfo badgeColour, string displayText = "Listing", bool startCollapsed = true)
: base(badgeColour, displayText, startCollapsed)
{
}
2018-07-24 10:04:18 +08:00
}
}
}