1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 06:32:55 +08:00

Follow web design more.

This commit is contained in:
Huo Yaoyuan 2017-06-13 19:43:56 +08:00
parent 9ceb4930e9
commit 3821360942

View File

@ -6,6 +6,7 @@ using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -20,12 +21,12 @@ namespace osu.Game.Users.Profile
private readonly OsuTextFlowContainer infoText; private readonly OsuTextFlowContainer infoText;
private const float cover_height = 200, avatar_size = 110, avatar_bottom_position = -20; private const float cover_height = 350, info_height = 150, avatar_size = 110, avatar_bottom_position = -20, level_position = 30, level_height = 60;
public ProfileHeader(User user) public ProfileHeader(User user)
{ {
this.user = user; this.user = user;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = cover_height + cover_height - UserProfile.TAB_HEIGHT; Height = cover_height + info_height - UserProfile.TAB_HEIGHT;
Children = new Drawable[] Children = new Drawable[]
{ {
@ -46,6 +47,11 @@ namespace osu.Game.Users.Profile
Masking = true, Masking = true,
RelativeSizeAxes = Axes.Both RelativeSizeAxes = Axes.Both
}, },
new Box
{
RelativeSizeAxes = Axes.Both,
ColourInfo = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f))
},
new UpdateableAvatar new UpdateableAvatar
{ {
User = user, User = user,
@ -101,8 +107,63 @@ namespace osu.Game.Users.Profile
Margin = new MarginPadding { Horizontal = UserProfile.CONTENT_X_MARGIN }, Margin = new MarginPadding { Horizontal = UserProfile.CONTENT_X_MARGIN },
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
ParagraphSpacing = 1, ParagraphSpacing = 1
//LineSpacing = 0.5f },
new Container
{
X = -UserProfile.CONTENT_X_MARGIN,
RelativeSizeAxes = Axes.Y,
Width = 280,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.X,
Y = level_position,
Height = level_height,
Children = new Drawable[]
{
new Box
{
Colour = Color4.Black.Opacity(0.5f),
RelativeSizeAxes = Axes.Both
}
}
},
new Container
{
RelativeSizeAxes = Axes.X,
Y = cover_height,
Anchor = Anchor.TopCentre,
Origin = Anchor.BottomCentre,
Height = cover_height - level_height - level_position - 5,
Children = new Drawable[]
{
new Box
{
Colour = Color4.Black.Opacity(0.5f),
RelativeSizeAxes = Axes.Both
}
}
},
new Container
{
RelativeSizeAxes = Axes.X,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Height = info_height - UserProfile.TAB_HEIGHT - 15,
Children = new Drawable[]
{
new Box
{
Colour = Color4.Black.Opacity(0.25f),
RelativeSizeAxes = Axes.Both
}
}
}
}
} }
}; };