mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
add Tooltips
This commit is contained in:
47
osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs
Normal file
47
osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs
Normal file
@ -0,0 +1,47 @@
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user