From fff30e8a6ea20b9189f87547e86be90cd01ddfa7 Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Wed, 30 Mar 2022 21:01:28 +0100 Subject: [PATCH] Simplify show/hide of text and search in `ChatTextBar` --- osu.Game/Overlays/Chat/ChatTextBar.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatTextBar.cs b/osu.Game/Overlays/Chat/ChatTextBar.cs index 7ff1b8d1d3..d7edbb83b6 100644 --- a/osu.Game/Overlays/Chat/ChatTextBar.cs +++ b/osu.Game/Overlays/Chat/ChatTextBar.cs @@ -108,16 +108,10 @@ protected override void LoadComplete() ShowSearch.BindValueChanged(change => { - if (change.NewValue) - { - chattingTextContainer.Hide(); - searchIconContainer.Show(); - } - else - { - chattingTextContainer.Show(); - searchIconContainer.Hide(); - } + bool showSearch = change.NewValue; + + chattingTextContainer.FadeTo(showSearch ? 0 : 1); + searchIconContainer.FadeTo(showSearch ? 1 : 0); }, true); currentChannel.BindValueChanged(change =>