1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 23:03:02 +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,50 +27,52 @@ 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[]
{ {
new OsuSpriteText background = new Box
{ {
Text = Title, RelativeSizeAxes = Axes.Both,
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular, italics: true),
Margin = new MarginPadding
{
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
Vertical = 10
}
}, },
content = new FillFlowContainer new FillFlowContainer
{ {
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Padding = new MarginPadding Children = new Drawable[]
{ {
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, new OsuSpriteText
Bottom = 20 {
} Text = Title,
}, Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular, italics: true),
new Box Margin = new MarginPadding
{ {
RelativeSizeAxes = Axes.X, Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
Height = 1, Vertical = 10
Colour = OsuColour.Gray(34), }
EdgeSmoothness = new Vector2(1) },
content = new FillFlowContainer
{
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Padding = new MarginPadding
{
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
Bottom = 20
}
},
},
} }
}; };
}
// 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