1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 15:52:54 +08:00

Allow section headers to wrap

This commit is contained in:
Dean Herbert 2022-03-16 17:19:08 +09:00
parent a0a033520f
commit ba1642a680
2 changed files with 21 additions and 13 deletions

View File

@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.UserInterface
})
},
},
new EditorSidebarSection("Section 2")
new EditorSidebarSection("Section with a really long section header")
{
Child = new FillFlowContainer
{

View File

@ -7,7 +7,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
using osuTK;
@ -49,24 +49,32 @@ namespace osu.Game.Screens.Edit.Components
Margin = new MarginPadding { Vertical = 10, Horizontal = 5 };
AutoSizeAxes = Axes.Both;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
InternalChildren = new Drawable[]
InternalChild = new FillFlowContainer
{
new OsuSpriteText
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(2),
Children = new Drawable[]
{
Text = text,
Font = OsuFont.Default.With(size: 16, weight: FontWeight.SemiBold),
},
new Circle
{
Y = 18,
Colour = colourProvider.Highlight1,
Size = new Vector2(28, 2),
new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 16, weight: FontWeight.SemiBold))
{
Text = text,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
},
new Circle
{
Colour = colourProvider.Highlight1,
Size = new Vector2(28, 2),
}
}
};
}