Add support for setting fixed size of status pill

This commit is contained in:
Bartłomiej Dach
2021-10-17 14:55:52 +02:00
parent 5ab3337a10
commit feedd53a53
2 changed files with 41 additions and 0 deletions

View File

@ -2,11 +2,16 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Overlays;
using osu.Game.Tests.Visual.UserInterface;
using osuTK;
@ -28,5 +33,16 @@ namespace osu.Game.Tests.Visual.Beatmaps
Status = status
})
};
private IEnumerable<BeatmapSetOnlineStatusPill> statusPills => this.ChildrenOfType<BeatmapSetOnlineStatusPill>();
[Test]
public void TestFixedWidth()
{
AddStep("create themed content", () => CreateThemedContent(OverlayColourScheme.Red));
AddStep("set fixed width", () => statusPills.ForEach(pill => pill.FixedWidth = 90));
AddStep("unset fixed width", () => statusPills.ForEach(pill => pill.FixedWidth = null));
}
}
}