This commit is contained in:
Andrei Zavatski 2019-10-14 17:33:14 +03:00
parent 139170cdc8
commit d4843285db
5 changed files with 12 additions and 16 deletions

View File

@ -23,13 +23,13 @@ namespace osu.Game.Graphics.UserInterface
public Color4 ChevronIconColour
{
get => chevronIconColour;
set { chevronIconColour = leftChevron.AccentColour = rightChevron.AccentColour = value; }
set => chevronIconColour = leftChevron.AccentColour = rightChevron.AccentColour = value;
}
public string Text
{
get => text.Text;
set { text.Text = value; }
set => text.Text = value;
}
private bool isLoading;
@ -136,7 +136,7 @@ namespace osu.Game.Graphics.UserInterface
public Color4 AccentColour
{
get => accentColour;
set { accentColour = Colour = value; }
set => accentColour = Colour = value;
}
public ChevronIcon()

View File

@ -42,7 +42,7 @@ namespace osu.Game.Online.API.Requests.Responses
public string Message { get; set; }
[JsonProperty(@"message_html")]
public string MessageHTML { get; set; }
public string MessageHtml { get; set; }
[JsonProperty(@"replies_count")]
public int RepliesCount { get; set; }
@ -95,7 +95,7 @@ namespace osu.Game.Online.API.Requests.Responses
if (IsDeleted)
return @"deleted";
return WebUtility.HtmlDecode(Regex.Replace(MessageHTML, @"<(.|\n)*?>", string.Empty));
return WebUtility.HtmlDecode(Regex.Replace(MessageHtml, @"<(.|\n)*?>", string.Empty));
}
public int GetDeletedChildsCount()

View File

@ -182,6 +182,7 @@ namespace osu.Game.Overlays.Comments
moreButton.Current.Value = response.TopLevelCount - loadedTopLevelComments;
moreButton.IsLoading = false;
}
moreButton.FadeTo(response.HasMore ? 1 : 0);
}, loadCancellation.Token);
}

View File

@ -28,13 +28,13 @@ namespace osu.Game.Overlays.Comments
private readonly BindableBool childExpanded = new BindableBool(true);
private readonly FillFlowContainer childCommentsVisibilityContainer;
private readonly DeletedChildsPlaceholder deletedChildsPlaceholder;
private readonly Comment comment;
public DrawableComment(Comment comment)
{
LinkFlowContainer username;
FillFlowContainer childCommentsContainer;
DeletedChildsPlaceholder deletedChildsPlaceholder;
FillFlowContainer info;
LinkFlowContainer message;
GridContainer content;
@ -93,7 +93,7 @@ namespace osu.Game.Overlays.Comments
Origin = Anchor.Centre,
Size = new Vector2(avatar_size),
Masking = true,
CornerRadius = avatar_size / 2,
CornerRadius = avatar_size / 2f,
},
}
},
@ -118,7 +118,7 @@ namespace osu.Game.Overlays.Comments
new ParentUsername(comment),
new SpriteText
{
Alpha = comment.IsDeleted? 1 : 0,
Alpha = comment.IsDeleted ? 1 : 0,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold, italics: true),
Text = @"deleted",
}
@ -299,8 +299,6 @@ namespace osu.Game.Overlays.Comments
private class ParentUsername : FillFlowContainer, IHasTooltip
{
private const int spacing = 3;
public string TooltipText => comment.ParentComment?.GetMessage() ?? "";
private readonly Comment comment;
@ -311,7 +309,7 @@ namespace osu.Game.Overlays.Comments
AutoSizeAxes = Axes.Both;
Direction = FillDirection.Horizontal;
Spacing = new Vector2(spacing, 0);
Spacing = new Vector2(3, 0);
Alpha = comment.ParentId == null ? 0 : 1;
Children = new Drawable[]
{
@ -331,13 +329,10 @@ namespace osu.Game.Overlays.Comments
private class VotePill : CircularContainer
{
private const int height = 20;
private const int margin = 10;
public VotePill(int count)
{
AutoSizeAxes = Axes.X;
Height = height;
Height = 20;
Masking = true;
Children = new Drawable[]
{

View File

@ -12,7 +12,7 @@ namespace osu.Game.Overlays.Comments
{
public readonly BindableBool Expanded = new BindableBool(true);
public ShowChildsButton()
protected ShowChildsButton()
{
AutoSizeAxes = Axes.Both;
}