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

Fix some layout issues

This commit is contained in:
EVAST9919 2017-11-18 18:41:00 +03:00
parent 87f1368869
commit 915ccf3c84

View File

@ -17,26 +17,24 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
{ {
public class KudosuInfo : Container public class KudosuInfo : Container
{ {
private const int content_text_size = 19; private readonly Bindable<User> user = new Bindable<User>();
protected readonly Bindable<User> User = new Bindable<User>();
public KudosuInfo(Bindable<User> user) public KudosuInfo(Bindable<User> user)
{ {
User.BindTo(user); this.user.BindTo(user);
SubSection total; SubSection total;
SubSection avaliable; SubSection avaliable;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = 130; AutoSizeAxes = Axes.Y;
Masking = true; Masking = true;
CornerRadius = 3; CornerRadius = 3;
EdgeEffect = new EdgeEffectParameters EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Offset = new Vector2(0f, 1f), Offset = new Vector2(0f, 1f),
Radius = 2.5f, Radius = 3f,
Colour = Color4.Black.Opacity(0.2f), Colour = Color4.Black.Opacity(0.2f),
}; };
Children = new Drawable[] Children = new Drawable[]
@ -46,18 +44,12 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.2f) Colour = OsuColour.Gray(0.2f)
}, },
new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[]
{
new Drawable[]
{
total = new SubSection("Total Kudosu Earned"), total = new SubSection("Total Kudosu Earned"),
avaliable = new SubSection("Kudosu Avaliable"), avaliable = new SubSection("Kudosu Avaliable")
} {
} RelativePositionAxes = Axes.X,
} X = 0.5f,
},
}; };
total.TextFlow.Text = "Based on how much of a contribution the user has made to " + total.TextFlow.Text = "Based on how much of a contribution the user has made to " +
@ -66,7 +58,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " +
"more attention. This is the number of kudosu you haven't traded in yet."; "more attention. This is the number of kudosu you haven't traded in yet.";
User.ValueChanged += newUser => this.user.ValueChanged += newUser =>
{ {
total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total; total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total;
avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available; avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available;
@ -97,8 +89,10 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
public SubSection(string header) public SubSection(string header)
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.X;
Padding = new MarginPadding { Horizontal = 10, Top = 10 }; Width = 0.5f;
AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Horizontal = 10, Top = 10, Bottom = 20 };
Child = new FillFlowContainer Child = new FillFlowContainer
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,