1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 10:02:59 +08:00

Fix margins and clean up implementation

This commit is contained in:
Dean Herbert 2019-09-19 15:34:46 +09:00
parent 9b35de9ce1
commit e0fd8609d1

View File

@ -16,7 +16,6 @@ namespace osu.Game.Screens.Select.Details
{ {
public class UserTopScoreContainer : VisibilityContainer public class UserTopScoreContainer : VisibilityContainer
{ {
private const int height = 90;
private const int duration = 500; private const int duration = 500;
private readonly Container scoreContainer; private readonly Container scoreContainer;
@ -30,33 +29,30 @@ namespace osu.Game.Screens.Select.Details
public UserTopScoreContainer() public UserTopScoreContainer()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = height; AutoSizeAxes = Axes.Y;
Anchor = Anchor.BottomLeft; Margin = new MarginPadding { Vertical = 5 };
Origin = Anchor.BottomLeft;
Children = new Drawable[] Children = new Drawable[]
{ {
new Container new FillFlowContainer
{ {
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = height, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Margin = new MarginPadding { Top = 5 },
Text = @"your personal best".ToUpper(), Text = @"your personal best".ToUpper(),
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold),
}, },
scoreContainer = new Container scoreContainer = new Container
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.TopCentre,
Origin = Anchor.BottomLeft, Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
} }
@ -89,14 +85,8 @@ namespace osu.Game.Screens.Select.Details
}, (loadScoreCancellation = new CancellationTokenSource()).Token); }, (loadScoreCancellation = new CancellationTokenSource()).Token);
} }
protected override void PopIn() protected override void PopIn() => this.FadeIn(duration, Easing.OutQuint);
{
this.FadeIn(duration, Easing.OutQuint);
}
protected override void PopOut() protected override void PopOut() => this.FadeOut(duration, Easing.OutQuint);
{
this.FadeOut(duration, Easing.OutQuint);
}
} }
} }