1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 12:02:55 +08:00

Show selected channel text as white in ChannelListItem

This commit is contained in:
Jai Sharma 2022-05-02 22:32:25 +01:00
parent 7f8e00c1e3
commit a931b1ecc3

View File

@ -126,13 +126,9 @@ namespace osu.Game.Overlays.Chat.ChannelList
{
base.LoadComplete();
selectedChannel.BindValueChanged(_ => updateSelectState(), true);
SelectorActive.BindValueChanged(_ => updateSelectState(), true);
Unread.BindValueChanged(change =>
{
text.FadeColour(change.NewValue ? colourProvider.Content1 : colourProvider.Light3, 300, Easing.OutQuint);
}, true);
selectedChannel.BindValueChanged(_ => updateState(), true);
SelectorActive.BindValueChanged(_ => updateState(), true);
Unread.BindValueChanged(_ => updateState(), true);
}
protected override bool OnHover(HoverEvent e)
@ -165,12 +161,21 @@ namespace osu.Game.Overlays.Chat.ChannelList
};
}
private void updateSelectState()
private void updateState()
{
if (selectedChannel.Value == Channel && !SelectorActive.Value)
if (showSelected)
selectBox.FadeIn(300, Easing.OutQuint);
else
selectBox.FadeOut(200, Easing.OutQuint);
if (showUnread || showSelected)
text.FadeColour(colourProvider.Content1, 300, Easing.OutQuint);
else
text.FadeColour(colourProvider.Light3, 200, Easing.OutQuint);
}
private bool showUnread => Unread.Value;
private bool showSelected => selectedChannel.Value == Channel && !SelectorActive.Value;
}
}