1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Add ability to override text in PageTabItem

This commit is contained in:
Andrei Zavatski 2019-09-12 05:03:59 +03:00
parent f9c6a8c5b7
commit c3c2efe35c

View File

@ -63,7 +63,7 @@ namespace osu.Game.Graphics.UserInterface
Margin = new MarginPadding { Top = 8, Bottom = 8 },
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Text = (value as Enum)?.GetDescription() ?? value.ToString(),
Text = CreateText(),
Font = OsuFont.GetFont(size: 14)
},
box = new Box
@ -81,6 +81,8 @@ namespace osu.Game.Graphics.UserInterface
Active.BindValueChanged(active => Text.Font = Text.Font.With(Typeface.Exo, weight: active.NewValue ? FontWeight.Bold : FontWeight.Medium), true);
}
protected virtual string CreateText() => (Value as Enum)?.GetDescription() ?? Value.ToString();
protected override bool OnHover(HoverEvent e)
{
if (!Active.Value)