2018-01-05 11:21:19 +00:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-09-18 13:32:49 +00:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
2018-03-02 06:34:31 +00:00
|
|
|
|
using NUnit.Framework;
|
2017-09-18 13:32:49 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-10-23 16:08:53 +00:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2017-09-18 13:32:49 +00:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
|
{
|
2018-03-02 06:34:31 +00:00
|
|
|
|
[TestFixture]
|
2017-12-20 12:47:45 +00:00
|
|
|
|
public class TestCaseTextAwesome : OsuTestCase
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
|
|
|
|
public TestCaseTextAwesome()
|
|
|
|
|
{
|
|
|
|
|
FillFlowContainer flow;
|
|
|
|
|
|
2017-10-23 16:08:53 +00:00
|
|
|
|
Add(new ScrollContainer
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-10-23 16:08:53 +00:00
|
|
|
|
Child = flow = new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Direction = FillDirection.Full,
|
|
|
|
|
},
|
2017-09-18 13:32:49 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
foreach (FontAwesome fa in Enum.GetValues(typeof(FontAwesome)))
|
2017-10-23 16:08:53 +00:00
|
|
|
|
flow.Add(new Icon(fa));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class Icon : Container, IHasTooltip
|
|
|
|
|
{
|
|
|
|
|
public string TooltipText { get; }
|
|
|
|
|
|
|
|
|
|
public Icon(FontAwesome fa)
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
2017-10-23 16:08:53 +00:00
|
|
|
|
TooltipText = fa.ToString();
|
|
|
|
|
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Child = new SpriteIcon
|
2017-09-18 13:32:49 +00:00
|
|
|
|
{
|
|
|
|
|
Icon = fa,
|
|
|
|
|
Size = new Vector2(60),
|
2017-10-23 16:08:53 +00:00
|
|
|
|
};
|
2017-09-18 13:32:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|