mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Improve condition check
This commit is contained in:
parent
1751e96840
commit
3970151e31
@ -15,6 +15,7 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using static osu.Framework.Graphics.Containers.TextFlowContainer;
|
||||
|
||||
namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
@ -133,9 +134,12 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
tryAddInfo(FontAwesome.Brands.Lastfm, user.Lastfm, $@"https://last.fm/users/{user.Lastfm}");
|
||||
tryAddInfo(FontAwesome.Solid.Link, websiteWithoutProtocol, user.Website);
|
||||
|
||||
// Hide the container to prevent adding unnecessary padding if it has no children other than the NewLine
|
||||
if (!bottomLinkContainer.Children.Skip(1).Any())
|
||||
// Hide the container to prevent adding unnecessary padding if it has no children other than the NewLineContainer
|
||||
if (!bottomLinkContainer.Children.Any(child => !(child is NewLineContainer)))
|
||||
bottomLinkContainer.Hide();
|
||||
else
|
||||
// this is needed if user gets changed without the whole header being reloaded
|
||||
bottomLinkContainer.Show();
|
||||
}
|
||||
|
||||
private void addSpacer(OsuTextFlowContainer textFlow) => textFlow.AddArbitraryDrawable(new Container { Width = 15 });
|
||||
|
Loading…
Reference in New Issue
Block a user