mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Add constructor argument to facilitate fixed width/autosizing
This commit is contained in:
@ -23,12 +23,11 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
AddStep("create button", () =>
|
||||
{
|
||||
Child = button = new ShearedToggleButton
|
||||
Child = button = new ShearedToggleButton(200)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Text = "Toggle me",
|
||||
Width = 200
|
||||
};
|
||||
});
|
||||
|
||||
@ -36,6 +35,28 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddToggleStep("toggle disabled", disabled => button.Active.Disabled = disabled);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSizing()
|
||||
{
|
||||
ShearedToggleButton toggleButton = null;
|
||||
|
||||
AddStep("create fixed width button", () => Child = toggleButton = new ShearedToggleButton(200)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Text = "Fixed width"
|
||||
});
|
||||
AddStep("change text", () => toggleButton.Text = "New text");
|
||||
|
||||
AddStep("create auto-sizing button", () => Child = toggleButton = new ShearedToggleButton
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Text = "This button autosizes to its text!"
|
||||
});
|
||||
AddStep("change text", () => toggleButton.Text = "New text");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDisabledState()
|
||||
{
|
||||
|
Reference in New Issue
Block a user