osu/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs

48 lines
1.4 KiB
C#
Raw Normal View History

2017-04-02 16:19:59 +00:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseTooltip : TestCase
{
public override string Description => "tests tooltips on various elements";
public override void Reset()
{
base.Reset();
Children = new Drawable[]
{
new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Children = new[]
{
new TooltipSpriteText
{
Text = "Text with some tooltip",
},
new TooltipSpriteText
{
Text = "and another one",
},
},
},
};
}
private class TooltipSpriteText : OsuSpriteText, IHasTooltip
{
public string Tooltip => Text;
}
}
}