1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 20:33:11 +08:00

Use correct background colour for sections

This commit is contained in:
Andrei Zavatski 2019-06-22 02:06:30 +03:00
parent 132cb8f473
commit dbf53e9bda
2 changed files with 36 additions and 34 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -8,18 +9,17 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Users; using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Profile namespace osu.Game.Overlays.Profile
{ {
public abstract class ProfileSection : FillFlowContainer public abstract class ProfileSection : Container
{ {
public abstract string Title { get; } public abstract string Title { get; }
public abstract string Identifier { get; } public abstract string Identifier { get; }
private readonly FillFlowContainer content; private readonly FillFlowContainer content;
private readonly Box background;
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
@ -27,10 +27,21 @@ namespace osu.Game.Overlays.Profile
protected ProfileSection() protected ProfileSection()
{ {
Direction = FillDirection.Vertical;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both,
},
new FillFlowContainer
{
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
{ {
@ -53,24 +64,15 @@ namespace osu.Game.Overlays.Profile
Bottom = 20 Bottom = 20
} }
}, },
new Box },
{
RelativeSizeAxes = Axes.X,
Height = 1,
Colour = OsuColour.Gray(34),
EdgeSmoothness = new Vector2(1)
} }
}; };
}
// placeholder [BackgroundDependencyLoader]
Add(new OsuSpriteText private void load(OsuColour colours)
{ {
Text = @"coming soon!", background.Colour = colours.GreySeafoamDarker;
Colour = Color4.Gray,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Margin = new MarginPadding { Top = 100, Bottom = 100 }
});
} }
} }
} }

View File

@ -66,7 +66,7 @@ namespace osu.Game.Overlays
Add(new Box Add(new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.2f) Colour = OsuColour.Gray(0.1f)
}); });
Add(sectionsContainer = new ProfileSectionsContainer Add(sectionsContainer = new ProfileSectionsContainer