mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 15:33:05 +08:00
Move user cover lower down
This commit is contained in:
parent
edb9c76edf
commit
ff22a91d52
@ -14,6 +14,7 @@ using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Users.Drawables;
|
||||
using osuTK;
|
||||
|
||||
@ -28,6 +29,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; } = null!;
|
||||
|
||||
private UserCoverBackground cover = null!;
|
||||
private SupporterIcon supporterTag = null!;
|
||||
private UpdateableAvatar avatar = null!;
|
||||
private OsuSpriteText usernameText = null!;
|
||||
@ -40,7 +42,8 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
Height = 150;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -50,13 +53,28 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
Colour = colourProvider.Background4,
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
cover = new ProfileCoverBackground
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 250,
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
Direction = FillDirection.Horizontal,
|
||||
Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN },
|
||||
Margin = new MarginPadding
|
||||
{
|
||||
Left = UserProfileOverlay.CONTENT_X_MARGIN,
|
||||
Vertical = 10
|
||||
},
|
||||
Height = avatar_size,
|
||||
AutoSizeAxes = Axes.X,
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
avatar = new UpdateableAvatar(isInteractive: false, showGuestOnNull: false)
|
||||
@ -86,7 +104,6 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(5),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
usernameText = new OsuSpriteText
|
||||
@ -95,20 +112,21 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
},
|
||||
openUserExternally = new ExternalLinkButton
|
||||
{
|
||||
Margin = new MarginPadding { Left = 5 },
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
},
|
||||
groupBadgeFlow = new GroupBadgeFlow
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
}
|
||||
}
|
||||
},
|
||||
titleText = new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Regular)
|
||||
},
|
||||
groupBadgeFlow = new GroupBadgeFlow
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
}
|
||||
}
|
||||
},
|
||||
new FillFlowContainer
|
||||
@ -159,6 +177,8 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@ -169,6 +189,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
var user = data?.User;
|
||||
|
||||
cover.User = user;
|
||||
avatar.User = user;
|
||||
usernameText.Text = user?.Username ?? string.Empty;
|
||||
openUserExternally.Link = $@"{api.WebsiteRootUrl}/users/{user?.Id ?? 0}";
|
||||
@ -179,5 +200,15 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
titleText.Colour = Color4Extensions.FromHex(user?.Colour ?? "fff");
|
||||
groupBadgeFlow.User.Value = user;
|
||||
}
|
||||
|
||||
private partial class ProfileCoverBackground : UserCoverBackground
|
||||
{
|
||||
protected override double LoadDelay => 0;
|
||||
|
||||
public ProfileCoverBackground()
|
||||
{
|
||||
Masking = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,23 +3,17 @@
|
||||
|
||||
using System.Diagnostics;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
public partial class ProfileHeader : TabControlOverlayHeader<LocalisableString>
|
||||
{
|
||||
private UserCoverBackground coverContainer = null!;
|
||||
|
||||
public Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
||||
|
||||
private CentreHeaderContainer centreHeaderContainer;
|
||||
@ -29,8 +23,6 @@ namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
ContentSidePadding = UserProfileOverlay.CONTENT_X_MARGIN;
|
||||
|
||||
User.ValueChanged += e => updateDisplay(e.NewValue);
|
||||
|
||||
TabControl.AddItem(LayoutStrings.HeaderUsersShow);
|
||||
|
||||
// todo: pending implementation.
|
||||
@ -41,25 +33,7 @@ namespace osu.Game.Overlays.Profile
|
||||
Debug.Assert(detailHeaderContainer != null);
|
||||
}
|
||||
|
||||
protected override Drawable CreateBackground() =>
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 150,
|
||||
Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
coverContainer = new ProfileCoverBackground
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = ColourInfo.GradientVertical(Color4Extensions.FromHex("222").Opacity(0.8f), Color4Extensions.FromHex("222").Opacity(0.2f))
|
||||
},
|
||||
}
|
||||
};
|
||||
protected override Drawable CreateBackground() => Empty();
|
||||
|
||||
protected override Drawable CreateContent() => new FillFlowContainer
|
||||
{
|
||||
@ -103,8 +77,6 @@ namespace osu.Game.Overlays.Profile
|
||||
User = { BindTarget = User }
|
||||
};
|
||||
|
||||
private void updateDisplay(UserProfileData? user) => coverContainer.User = user?.User;
|
||||
|
||||
private partial class ProfileHeaderTitle : OverlayTitle
|
||||
{
|
||||
public ProfileHeaderTitle()
|
||||
@ -113,10 +85,5 @@ namespace osu.Game.Overlays.Profile
|
||||
IconTexture = "Icons/Hexacons/profile";
|
||||
}
|
||||
}
|
||||
|
||||
private partial class ProfileCoverBackground : UserCoverBackground
|
||||
{
|
||||
protected override double LoadDelay => 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user