mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Merge pull request #22507 from Joehuu/fix-comment-padding
Fix comments having too much padding at the bottom
This commit is contained in:
commit
78eae171ed
@ -76,6 +76,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
private GridContainer content = null!;
|
private GridContainer content = null!;
|
||||||
private VotePill votePill = null!;
|
private VotePill votePill = null!;
|
||||||
private Container<CommentEditor> replyEditorContainer = null!;
|
private Container<CommentEditor> replyEditorContainer = null!;
|
||||||
|
private Container repliesButtonContainer = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IDialogOverlay? dialogOverlay { get; set; }
|
private IDialogOverlay? dialogOverlay { get; set; }
|
||||||
@ -239,10 +240,12 @@ namespace osu.Game.Overlays.Comments
|
|||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Padding = new MarginPadding { Top = 10 },
|
Padding = new MarginPadding { Top = 10 },
|
||||||
|
Alpha = 0,
|
||||||
},
|
},
|
||||||
new Container
|
repliesButtonContainer = new Container
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
showRepliesButton = new ShowRepliesButton(Comment.RepliesCount)
|
showRepliesButton = new ShowRepliesButton(Comment.RepliesCount)
|
||||||
@ -449,6 +452,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
{
|
{
|
||||||
if (replyEditorContainer.Count == 0)
|
if (replyEditorContainer.Count == 0)
|
||||||
{
|
{
|
||||||
|
replyEditorContainer.Show();
|
||||||
replyEditorContainer.Add(new ReplyCommentEditor(Comment)
|
replyEditorContainer.Add(new ReplyCommentEditor(Comment)
|
||||||
{
|
{
|
||||||
OnPost = comments =>
|
OnPost = comments =>
|
||||||
@ -456,12 +460,14 @@ namespace osu.Game.Overlays.Comments
|
|||||||
Comment.RepliesCount += comments.Length;
|
Comment.RepliesCount += comments.Length;
|
||||||
showRepliesButton.Count = Comment.RepliesCount;
|
showRepliesButton.Count = Comment.RepliesCount;
|
||||||
Replies.AddRange(comments);
|
Replies.AddRange(comments);
|
||||||
}
|
},
|
||||||
|
OnCancel = toggleReply
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
replyEditorContainer.Clear(true);
|
replyEditorContainer.ForEach(e => e.Expire());
|
||||||
|
replyEditorContainer.Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,9 +519,11 @@ namespace osu.Game.Overlays.Comments
|
|||||||
int loadedRepliesCount = loadedReplies.Count;
|
int loadedRepliesCount = loadedReplies.Count;
|
||||||
bool hasUnloadedReplies = loadedRepliesCount != Comment.RepliesCount;
|
bool hasUnloadedReplies = loadedRepliesCount != Comment.RepliesCount;
|
||||||
|
|
||||||
loadRepliesButton.FadeTo(hasUnloadedReplies && loadedRepliesCount == 0 ? 1 : 0);
|
|
||||||
showMoreButton.FadeTo(hasUnloadedReplies && loadedRepliesCount > 0 ? 1 : 0);
|
|
||||||
showRepliesButton.FadeTo(loadedRepliesCount != 0 ? 1 : 0);
|
showRepliesButton.FadeTo(loadedRepliesCount != 0 ? 1 : 0);
|
||||||
|
loadRepliesButton.FadeTo(hasUnloadedReplies && loadedRepliesCount == 0 ? 1 : 0);
|
||||||
|
repliesButtonContainer.FadeTo(repliesButtonContainer.Any(child => child.Alpha > 0) ? 1 : 0);
|
||||||
|
|
||||||
|
showMoreButton.FadeTo(hasUnloadedReplies && loadedRepliesCount > 0 ? 1 : 0);
|
||||||
|
|
||||||
if (Comment.IsTopLevel)
|
if (Comment.IsTopLevel)
|
||||||
chevronButton.FadeTo(loadedRepliesCount != 0 ? 1 : 0);
|
chevronButton.FadeTo(loadedRepliesCount != 0 ? 1 : 0);
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
@ -33,7 +32,6 @@ namespace osu.Game.Overlays.Comments
|
|||||||
public ReplyCommentEditor(Comment parent)
|
public ReplyCommentEditor(Comment parent)
|
||||||
{
|
{
|
||||||
parentComment = parent;
|
parentComment = parent;
|
||||||
OnCancel = () => this.FadeOut(200).Expire();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
Loading…
Reference in New Issue
Block a user