mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Fix enum descriptions not being displayed in OverlayHeaderTabControl
This commit is contained in:
parent
6169349f7c
commit
ce9dd0c920
@ -1,9 +1,11 @@
|
||||
// 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 System;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@ -104,7 +106,7 @@ namespace osu.Game.Overlays
|
||||
public OverlayHeaderTabItem(T value)
|
||||
: base(value)
|
||||
{
|
||||
Text.Text = value.ToString().ToLower();
|
||||
Text.Text = ((Value as Enum)?.GetDescription() ?? Value.ToString()).ToLower();
|
||||
Text.Font = OsuFont.GetFont(size: 14);
|
||||
Text.Margin = new MarginPadding { Vertical = 16.5f }; // 15px padding + 1.5px line-height difference compensation
|
||||
Bar.Margin = new MarginPadding { Bottom = bar_height };
|
||||
|
Loading…
Reference in New Issue
Block a user