2019-09-25 16:42:35 +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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2019-09-25 16:42:35 +08:00
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-09-25 16:53:08 +08:00
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
2019-09-25 16:42:35 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
public partial class TestSceneLabelledSwitchButton : OsuTestScene
|
2019-09-25 16:42:35 +08:00
|
|
|
{
|
|
|
|
[TestCase(false)]
|
|
|
|
[TestCase(true)]
|
|
|
|
public void TestSwitchButton(bool hasDescription) => createSwitchButton(hasDescription);
|
|
|
|
|
|
|
|
private void createSwitchButton(bool hasDescription = false)
|
|
|
|
{
|
|
|
|
AddStep("create component", () =>
|
|
|
|
{
|
|
|
|
LabelledSwitchButton component;
|
|
|
|
|
|
|
|
Child = new Container
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Width = 500,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Child = component = new LabelledSwitchButton
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
component.Label = "a sample component";
|
|
|
|
component.Description = hasDescription ? "this text describes the component" : string.Empty;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|