Refactor SpotlightSelector layout

This commit is contained in:
Andrei Zavatski 2020-07-14 17:34:01 +03:00
parent c49ce65326
commit c2c80d2a98

View File

@ -50,10 +50,11 @@ namespace osu.Game.Overlays.Rankings
public SpotlightSelector() public SpotlightSelector()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = 100; AutoSizeAxes = Axes.Y;
Add(content = new Container Add(content = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[] Children = new Drawable[]
{ {
background = new Box background = new Box
@ -62,31 +63,52 @@ namespace osu.Game.Overlays.Rankings
}, },
new Container new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.X,
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 }, AutoSizeAxes = Axes.Y,
Children = new Drawable[] Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN },
Child = new FillFlowContainer
{ {
dropdown = new SpotlightsDropdown RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{ {
Anchor = Anchor.TopCentre, new Container
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
Current = Current,
Depth = -float.MaxValue
},
new FillFlowContainer
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(15, 0),
Children = new Drawable[]
{ {
startDateColumn = new InfoColumn(@"Start Date"), Margin = new MarginPadding { Vertical = 20 },
endDateColumn = new InfoColumn(@"End Date"), RelativeSizeAxes = Axes.X,
mapCountColumn = new InfoColumn(@"Map Count"), Height = 40,
participantsColumn = new InfoColumn(@"Participants") Depth = -float.MaxValue,
Child = dropdown = new SpotlightsDropdown
{
RelativeSizeAxes = Axes.X,
Current = Current
}
},
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0),
Margin = new MarginPadding { Vertical = 5 },
Children = new Drawable[]
{
startDateColumn = new InfoColumn(@"Start Date"),
endDateColumn = new InfoColumn(@"End Date"),
mapCountColumn = new InfoColumn(@"Map Count"),
participantsColumn = new InfoColumn(@"Participants")
}
},
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Vertical = 20 },
Child = new RankingsSortTabControl
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight
}
} }
} }
} }
@ -128,12 +150,13 @@ namespace osu.Game.Overlays.Rankings
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Direction = FillDirection.Vertical; Direction = FillDirection.Vertical;
Margin = new MarginPadding { Vertical = 10 };
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = name, Text = name,
Font = OsuFont.GetFont(size: 10), Font = OsuFont.GetFont(size: 10, weight: FontWeight.Regular),
}, },
new Container new Container
{ {
@ -143,7 +166,7 @@ namespace osu.Game.Overlays.Rankings
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Light), Font = OsuFont.GetFont(size: 20, weight: FontWeight.Light),
} }
} }
}; };