1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +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,30 +32,28 @@ namespace osu.Game.Tests.Visual.Online
public TestSceneCommentsPage()
{
AddRange(new Drawable[]
Add(new FillFlowContainer
{
new Box
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 10),
Children = new Drawable[]
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Children = new Drawable[]
new Container
{
new OsuCheckbox
AutoSizeAxes = Axes.Y,
Width = 200,
Child = new OsuCheckbox
{
Current = showDeleted,
LabelText = @"Show Deleted"
},
content = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
}
},
content = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
}
}
});

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 }
});