1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 02:57:18 +08:00

Only show team channel section when there is a team channel

This commit is contained in:
Bartłomiej Dach 2025-02-24 15:06:02 +01:00
parent 4ac4b308e1
commit e8f7bcb6e6
No known key found for this signature in database
2 changed files with 4 additions and 9 deletions

View File

@ -115,11 +115,7 @@ namespace osu.Game.Tests.Visual.Online
channelList.AddChannel(createRandomPrivateChannel());
});
AddStep("Add Team Channels", () =>
{
for (int i = 0; i < 10; i++)
channelList.AddChannel(createRandomTeamChannel());
});
AddStep("Add Team Channel", () => channelList.AddChannel(createRandomTeamChannel()));
AddStep("Add Announce Channels", () =>
{

View File

@ -106,6 +106,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
};
selector.OnRequestSelect += chan => OnRequestSelect?.Invoke(chan);
updateVisibility();
}
public void AddChannel(Channel channel)
@ -170,10 +171,8 @@ namespace osu.Game.Overlays.Chat.ChannelList
private void updateVisibility()
{
if (AnnounceChannelGroup.ItemFlow.Children.Count == 0)
AnnounceChannelGroup.Hide();
else
AnnounceChannelGroup.Show();
AnnounceChannelGroup.Alpha = AnnounceChannelGroup.ItemFlow.Any() ? 1 : 0;
TeamChannelGroup.Alpha = TeamChannelGroup.ItemFlow.Any() ? 1 : 0;
}
public partial class ChannelGroup : FillFlowContainer