Fix text overflowing on dropdown headers

This commit is contained in:
Joseph Madamba
2021-09-24 21:57:52 -07:00
parent 7f350fe5c5
commit 9b9c30c8a1

View File

@ -274,21 +274,40 @@ namespace osu.Game.Graphics.UserInterface
CornerRadius = corner_radius; CornerRadius = corner_radius;
Height = 40; Height = 40;
Foreground.Children = new Drawable[] Foreground.Child = new GridContainer
{ {
Text = new OsuSpriteText RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
RowDimensions = new[]
{ {
Anchor = Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize),
Origin = Anchor.CentreLeft,
}, },
Icon = new SpriteIcon ColumnDimensions = new[]
{ {
Icon = FontAwesome.Solid.ChevronDown, new Dimension(),
Anchor = Anchor.CentreRight, new Dimension(GridSizeMode.AutoSize),
Origin = Anchor.CentreRight,
Margin = new MarginPadding { Right = 5 },
Size = new Vector2(12),
}, },
Content = new[]
{
new Drawable[]
{
Text = new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
Truncate = true,
},
Icon = new SpriteIcon
{
Icon = FontAwesome.Solid.ChevronDown,
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Margin = new MarginPadding { Horizontal = 5 },
Size = new Vector2(12),
},
}
}
}; };
AddInternal(new HoverClickSounds()); AddInternal(new HoverClickSounds());