mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 03:13:21 +08:00
Improve section behaviour.
This commit is contained in:
parent
8dce52e6a8
commit
51107acdff
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -13,27 +14,44 @@ namespace osu.Game.Users.Profile
|
|||||||
{
|
{
|
||||||
public abstract string Title { get; }
|
public abstract string Title { get; }
|
||||||
|
|
||||||
|
private readonly FillFlowContainer content;
|
||||||
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
protected ProfileSection()
|
protected ProfileSection()
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Horizontal = UserProfile.CONTENT_X_MARGIN };
|
|
||||||
Direction = FillDirection.Vertical;
|
Direction = FillDirection.Vertical;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Children = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Title,
|
Text = Title,
|
||||||
TextSize = 16,
|
TextSize = 16,
|
||||||
Font = @"Exo2.0-RegularItalic",
|
Font = @"Exo2.0-RegularItalic",
|
||||||
Margin = new MarginPadding { Vertical = 20 }
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Horizontal = UserProfile.CONTENT_X_MARGIN,
|
||||||
|
Vertical = 20
|
||||||
|
}
|
||||||
|
},
|
||||||
|
content = new FillFlowContainer
|
||||||
|
{
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Horizontal = UserProfile.CONTENT_X_MARGIN,
|
||||||
|
Bottom = 20
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 1,
|
Height = 1,
|
||||||
Colour = OsuColour.Gray(34),
|
Colour = OsuColour.Gray(34),
|
||||||
Depth = float.MinValue
|
EdgeSmoothness = new Vector2(1)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user