mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Add ability to override text in PageTabItem
This commit is contained in:
parent
f9c6a8c5b7
commit
c3c2efe35c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user