mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 05:52:54 +08:00
Add ability to override text size
This commit is contained in:
parent
54a3705bdb
commit
e62fec58c1
@ -37,6 +37,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
new BeatmapSearchRulesetFilter(),
|
||||
new BeatmapSearchFilter<BeatmapSearchCategory>(),
|
||||
new SmallBeatmapSearchFilter<BeatmapSearchCategory>()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
|
||||
protected class FilterTabItem : TabItem<T>
|
||||
{
|
||||
protected virtual float TextSize() => 13;
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; }
|
||||
|
||||
@ -53,7 +55,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
{
|
||||
text = new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Regular),
|
||||
Font = OsuFont.GetFont(size: TextSize(), weight: FontWeight.Regular),
|
||||
Text = GetText(value)
|
||||
},
|
||||
new HoverClickSounds()
|
||||
|
22
osu.Game/Overlays/BeatmapListing/SmallBeatmapSearchFilter.cs
Normal file
22
osu.Game/Overlays/BeatmapListing/SmallBeatmapSearchFilter.cs
Normal file
@ -0,0 +1,22 @@
|
||||
// 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 osu.Framework.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapListing
|
||||
{
|
||||
public class SmallBeatmapSearchFilter<T> : BeatmapSearchFilter<T>
|
||||
{
|
||||
protected override TabItem<T> CreateTabItem(T value) => new SmallTabItem(value);
|
||||
|
||||
protected class SmallTabItem : FilterTabItem
|
||||
{
|
||||
public SmallTabItem(T value)
|
||||
: base(value)
|
||||
{
|
||||
}
|
||||
|
||||
protected override float TextSize() => 10;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user