From 850a7aa32772a3136dffed86182a8a75986050a2 Mon Sep 17 00:00:00 2001 From: Roman Kapustin Date: Sat, 29 Dec 2018 17:43:19 +0300 Subject: [PATCH] Update tab text font on activation/deactivation --- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 3 ++- osu.Game/Graphics/UserInterface/PageTabControl.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index 488e16b6fb..989528e5cd 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -160,7 +160,6 @@ namespace osu.Game.Graphics.UserInterface Anchor = Anchor.BottomLeft, Text = (value as IHasDescription)?.Description ?? (value as Enum)?.GetDescription() ?? value.ToString(), TextSize = 14, - Font = @"Exo2.0-Bold", // Font should only turn bold when active? }, Bar = new Box { @@ -173,6 +172,8 @@ namespace osu.Game.Graphics.UserInterface }, new HoverClickSounds() }; + + Active.BindValueChanged(val => Text.Font = val ? @"Exo2.0-Bold" : @"Exo2.0", true); } protected override void OnActivated() => fadeActive(); diff --git a/osu.Game/Graphics/UserInterface/PageTabControl.cs b/osu.Game/Graphics/UserInterface/PageTabControl.cs index 50e4743028..15a27b1f6f 100644 --- a/osu.Game/Graphics/UserInterface/PageTabControl.cs +++ b/osu.Game/Graphics/UserInterface/PageTabControl.cs @@ -46,7 +46,6 @@ namespace osu.Game.Graphics.UserInterface Anchor = Anchor.BottomLeft, Text = (value as Enum)?.GetDescription() ?? value.ToString(), TextSize = 14, - Font = @"Exo2.0-Bold", }, box = new Box { @@ -59,6 +58,8 @@ namespace osu.Game.Graphics.UserInterface }, new HoverClickSounds() }; + + Active.BindValueChanged(val => Text.Font = val ? @"Exo2.0-Bold" : @"Exo2.0", true); } [BackgroundDependencyLoader]