1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00

Cleanup pass

This commit is contained in:
Andrei Zavatski 2020-01-29 06:58:53 +03:00
parent dc10e58b4f
commit 5fcda01346
2 changed files with 37 additions and 24 deletions

View File

@ -12,8 +12,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osuTK.Graphics;
using osuTK;
namespace osu.Game.Tests.Visual.Online
{
@ -33,24 +32,23 @@ namespace osu.Game.Tests.Visual.Online
public TestSceneCommentsPage()
{
AddRange(new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
new FillFlowContainer
Add(new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 10),
Children = new Drawable[]
{
new OsuCheckbox
new Container
{
AutoSizeAxes = Axes.Y,
Width = 200,
Child = new OsuCheckbox
{
Current = showDeleted,
LabelText = @"Show Deleted"
}
},
content = new Container
{
@ -58,7 +56,6 @@ namespace osu.Game.Tests.Visual.Online
AutoSizeAxes = Axes.Y,
}
}
}
});
AddStep("load comments", () => createPage(comment_bundle));

View File

@ -12,7 +12,7 @@ using System.Linq;
namespace osu.Game.Overlays.Comments
{
public class CommentsPage : FillFlowContainer
public class CommentsPage : CompositeDrawable
{
public readonly BindableBool ShowDeleted = new BindableBool();
@ -24,15 +24,31 @@ namespace osu.Game.Overlays.Comments
}
[BackgroundDependencyLoader]
private void load()
private void load(OverlayColourProvider colourProvider)
{
FillFlowContainer flow;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
AddRangeInternal(new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5
},
flow = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
}
});
if (!commentBundle.Comments.Any())
{
Add(new NoCommentsPlaceholder());
flow.Add(new NoCommentsPlaceholder());
return;
}
@ -40,7 +56,7 @@ namespace osu.Game.Overlays.Comments
{
if (c.IsTopLevel)
{
Add(new DrawableComment(c)
flow.Add(new DrawableComment(c)
{
ShowDeleted = { BindTarget = ShowDeleted }
});