mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Add ability to override text size
This commit is contained in:
@ -37,6 +37,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
new BeatmapSearchRulesetFilter(),
|
new BeatmapSearchRulesetFilter(),
|
||||||
new BeatmapSearchFilter<BeatmapSearchCategory>(),
|
new BeatmapSearchFilter<BeatmapSearchCategory>(),
|
||||||
|
new SmallBeatmapSearchFilter<BeatmapSearchCategory>()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
protected class FilterTabItem : TabItem<T>
|
protected class FilterTabItem : TabItem<T>
|
||||||
{
|
{
|
||||||
|
protected virtual float TextSize() => 13;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; }
|
private OverlayColourProvider colourProvider { get; set; }
|
||||||
|
|
||||||
@ -53,7 +55,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
{
|
{
|
||||||
text = new OsuSpriteText
|
text = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Regular),
|
Font = OsuFont.GetFont(size: TextSize(), weight: FontWeight.Regular),
|
||||||
Text = GetText(value)
|
Text = GetText(value)
|
||||||
},
|
},
|
||||||
new HoverClickSounds()
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user