-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ppy#18180 from frenzibyte/fix-toolbox-double-tap
Fix `SettingsToolboxGroup` not clearing transforms before updating autosize
- Loading branch information
Showing
3 changed files
with
66 additions
and
57 deletions.
There are no files selected for viewing
57 changes: 0 additions & 57 deletions
57
osu.Game.Tests/Visual/Gameplay/TestSceneReplaySettingsOverlay.cs
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
osu.Game.Tests/Visual/UserInterface/TestSceneSettingsToolboxGroup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// 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. | ||
|
||
using System.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Testing; | ||
using osu.Game.Graphics.UserInterface; | ||
using osu.Game.Graphics.UserInterfaceV2; | ||
using osu.Game.Overlays; | ||
using osu.Game.Overlays.Settings; | ||
using osuTK.Input; | ||
|
||
namespace osu.Game.Tests.Visual.UserInterface | ||
{ | ||
[TestFixture] | ||
public class TestSceneSettingsToolboxGroup : OsuManualInputManagerTestScene | ||
{ | ||
private SettingsToolboxGroup group; | ||
|
||
[SetUp] | ||
public void SetUp() => Schedule(() => | ||
{ | ||
Child = group = new SettingsToolboxGroup("example") | ||
{ | ||
Children = new Drawable[] | ||
{ | ||
new RoundedButton | ||
{ | ||
RelativeSizeAxes = Axes.X, | ||
Text = @"Button", | ||
Enabled = { Value = true }, | ||
}, | ||
new OsuCheckbox | ||
{ | ||
LabelText = @"Checkbox", | ||
}, | ||
new OutlinedTextBox | ||
{ | ||
RelativeSizeAxes = Axes.X, | ||
Height = 30, | ||
PlaceholderText = @"Textbox", | ||
} | ||
}, | ||
}; | ||
}); | ||
|
||
[Test] | ||
public void TestClickExpandButtonMultipleTimes() | ||
{ | ||
AddAssert("group expanded by default", () => group.Expanded.Value); | ||
AddStep("click expand button multiple times", () => | ||
{ | ||
InputManager.MoveMouseTo(group.ChildrenOfType<IconButton>().Single()); | ||
Scheduler.AddDelayed(() => InputManager.Click(MouseButton.Left), 100); | ||
Scheduler.AddDelayed(() => InputManager.Click(MouseButton.Left), 200); | ||
Scheduler.AddDelayed(() => InputManager.Click(MouseButton.Left), 300); | ||
}); | ||
AddAssert("group contracted", () => !group.Expanded.Value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters