mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 19:52:55 +08:00
Allow section headers to wrap
This commit is contained in:
parent
a0a033520f
commit
ba1642a680
@ -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
|
||||
{
|
||||
|
@ -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,25 +49,33 @@ 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[]
|
||||
{
|
||||
new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 16, weight: FontWeight.SemiBold))
|
||||
{
|
||||
Text = text,
|
||||
Font = OsuFont.Default.With(size: 16, weight: FontWeight.SemiBold),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
},
|
||||
new Circle
|
||||
{
|
||||
Y = 18,
|
||||
Colour = colourProvider.Highlight1,
|
||||
Size = new Vector2(28, 2),
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user