1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-15 10:32:50 +08:00
Files
osu-lazer/osu.Game.Tests/Visual/UserInterface/TestSceneShearedSearchTextBox.cs
T
Dean Herbert 1edbdc5aac Update filter control's status text with beatmap displayed count
This also fixes code running in `Update` which shouldn't be, by
consuming the new `NewItemsPresented` callback.

Fields and properties are renamed to knock some sense into things (was
previously called two or three different things).
2025-05-09 15:05:41 +09:00

65 lines
2.2 KiB
C#

// 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;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Tests.Visual.UserInterface
{
public partial class TestSceneShearedSearchTextBox : OsuTestScene
{
[Test]
public void TestAllColourSchemes()
{
foreach (var scheme in Enum.GetValues(typeof(OverlayColourScheme)).Cast<OverlayColourScheme>())
AddStep($"set {scheme} scheme", () => Child = createContent(scheme));
}
private Drawable createContent(OverlayColourScheme colourScheme)
{
var colourProvider = new OverlayColourProvider(colourScheme);
return new DependencyProvidingContainer
{
RelativeSizeAxes = Axes.Both,
CachedDependencies = new (Type, object)[]
{
(typeof(OverlayColourProvider), colourProvider)
},
Child = new FillFlowContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0f, 5f),
Children = new Drawable[]
{
new ShearedSearchTextBox
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Width = 0.5f
},
new ShearedFilterTextBox
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Width = 0.5f,
StatusText = "12345 matches",
},
}
},
};
}
}
}