Fix intermittent failure in certain beatmap carousel tests

This commit is contained in:
Salman Ahmed 2023-01-13 18:32:56 +03:00
parent b3d4da8fc9
commit 112cf403ec
1 changed files with 9 additions and 2 deletions

View File

@ -21,6 +21,8 @@ public partial class SetPanelContent : CompositeDrawable
private readonly CarouselBeatmapSet carouselSet;
private FillFlowContainer<DifficultyIcon> iconFlow = null!;
public SetPanelContent(CarouselBeatmapSet carouselSet)
{
this.carouselSet = carouselSet;
@ -82,13 +84,12 @@ private void load()
TextPadding = new MarginPadding { Horizontal = 8, Vertical = 2 },
Status = beatmapSet.Status
},
new FillFlowContainer<DifficultyIcon>
iconFlow = new FillFlowContainer<DifficultyIcon>
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
Spacing = new Vector2(3),
ChildrenEnumerable = getDifficultyIcons(),
},
}
}
@ -96,6 +97,12 @@ private void load()
};
}
protected override void LoadComplete()
{
base.LoadComplete();
iconFlow.ChildrenEnumerable = getDifficultyIcons();
}
private const int maximum_difficulty_icons = 18;
private IEnumerable<DifficultyIcon> getDifficultyIcons()