Allow better async support for CommentsContainer

This commit is contained in:
Andrei Zavatski
2020-01-28 10:21:27 +03:00
parent 4e884fc6f4
commit 5a2fd18bdd

View File

@ -30,22 +30,22 @@ namespace osu.Game.Overlays.Comments
private CancellationTokenSource loadCancellation; private CancellationTokenSource loadCancellation;
private int currentPage; private int currentPage;
private readonly Box background; private FillFlowContainer content;
private readonly Box footerBackground; private DeletedChildrenPlaceholder deletedChildrenPlaceholder;
private readonly FillFlowContainer content; private CommentsShowMoreButton moreButton;
private readonly DeletedChildrenPlaceholder deletedChildrenPlaceholder; private TotalCommentsCounter commentCounter;
private readonly CommentsShowMoreButton moreButton;
private readonly TotalCommentsCounter commentCounter;
public CommentsContainer() [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
AddRangeInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
background = new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5
}, },
new FillFlowContainer new FillFlowContainer
{ {
@ -72,9 +72,10 @@ namespace osu.Game.Overlays.Comments
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Children = new Drawable[] Children = new Drawable[]
{ {
footerBackground = new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4
}, },
new FillFlowContainer new FillFlowContainer
{ {
@ -109,13 +110,6 @@ namespace osu.Game.Overlays.Comments
}); });
} }
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
background.Colour = colourProvider.Background5;
footerBackground.Colour = colourProvider.Background4;
}
protected override void LoadComplete() protected override void LoadComplete()
{ {
Sort.BindValueChanged(_ => refetchComments(), true); Sort.BindValueChanged(_ => refetchComments(), true);