1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 11:27:24 +08:00

Add TotalCommentsCounter to CommentsContainer

This commit is contained in:
Andrei Zavatski 2020-01-23 15:56:01 +03:00
parent f5b280971f
commit 6493f24547

View File

@ -38,6 +38,7 @@ namespace osu.Game.Overlays.Comments
private readonly FillFlowContainer content;
private readonly DeletedChildrenPlaceholder deletedChildrenPlaceholder;
private readonly CommentsShowMoreButton moreButton;
private readonly TotalCommentsCounter commentCounter;
public CommentsContainer()
{
@ -56,6 +57,7 @@ namespace osu.Game.Overlays.Comments
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
commentCounter = new TotalCommentsCounter(),
new CommentsHeader
{
Sort = { BindTarget = Sort },
@ -133,6 +135,7 @@ namespace osu.Game.Overlays.Comments
if (!IsLoaded)
return;
commentCounter.Current.Value = 0;
refetchComments();
}
@ -199,6 +202,8 @@ namespace osu.Game.Overlays.Comments
moreButton.IsLoading = false;
}
commentCounter.Current.Value = response.Total;
moreButton.FadeTo(response.HasMore ? 1 : 0);
}, loadCancellation.Token);
}