1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:32:55 +08:00

Add spacing between sections

This commit is contained in:
Andrei Zavatski 2019-06-22 01:11:04 +03:00
parent c34a7dd255
commit 132cb8f473

View File

@ -4,6 +4,7 @@
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
@ -23,7 +24,7 @@ namespace osu.Game.Overlays
private ProfileSection[] sections;
private GetUserRequest userReq;
protected ProfileHeader Header;
private SectionsContainer<ProfileSection> sectionsContainer;
private ProfileSectionsContainer sectionsContainer;
private ProfileTabControl tabs;
public const float CONTENT_X_MARGIN = 70;
@ -68,9 +69,8 @@ namespace osu.Game.Overlays
Colour = OsuColour.Gray(0.2f)
});
Add(sectionsContainer = new SectionsContainer<ProfileSection>
Add(sectionsContainer = new ProfileSectionsContainer
{
RelativeSizeAxes = Axes.Both,
ExpandableHeader = Header = new ProfileHeader(),
FixedHeader = tabs,
HeaderBackground = new Box
@ -180,5 +180,22 @@ namespace osu.Game.Overlays
bottom.Colour = colours.Yellow;
}
}
private class ProfileSectionsContainer : SectionsContainer<ProfileSection>
{
public ProfileSectionsContainer()
{
RelativeSizeAxes = Axes.Both;
}
protected override FlowContainer<ProfileSection> CreateScrollContentContainer()
=> new FillFlowContainer<ProfileSection>
{
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Spacing = new Vector2(0, 20),
};
}
}
}