mirror of https://github.com/ppy/osu
Add ability to override text size
This commit is contained in:
parent
54a3705bdb
commit
e62fec58c1
|
@ -37,6 +37,7 @@ public TestSceneBeatmapSearchFilter()
|
|||
{
|
||||
new BeatmapSearchRulesetFilter(),
|
||||
new BeatmapSearchFilter<BeatmapSearchCategory>(),
|
||||
new SmallBeatmapSearchFilter<BeatmapSearchCategory>()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -40,6 +40,8 @@ public BeatmapSearchFilter()
|
|||
|
||||
protected class FilterTabItem : TabItem<T>
|
||||
{
|
||||
protected virtual float TextSize() => 13;
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; }
|
||||
|
||||
|
@ -53,7 +55,7 @@ public FilterTabItem(T value)
|
|||
{
|
||||
text = new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Regular),
|
||||
Font = OsuFont.GetFont(size: TextSize(), weight: FontWeight.Regular),
|
||||
Text = GetText(value)
|
||||
},
|
||||
new HoverClickSounds()
|
||||
|
|
|
@ -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