Merge pull request #14848 from Joehuu/fix-dropdown-text-overflow

Fix text overflowing on dropdown headers
This commit is contained in:
Bartłomiej Dach
2021-09-25 15:37:12 +02:00
committed by GitHub

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
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
},
ColumnDimensions = new[]
{
new Dimension(),
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new Drawable[]
{ {
Text = new OsuSpriteText Text = new OsuSpriteText
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
Truncate = true,
}, },
Icon = new SpriteIcon Icon = new SpriteIcon
{ {
Icon = FontAwesome.Solid.ChevronDown, Icon = FontAwesome.Solid.ChevronDown,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Margin = new MarginPadding { Right = 5 }, Margin = new MarginPadding { Horizontal = 5 },
Size = new Vector2(12), Size = new Vector2(12),
}, },
}
}
}; };
AddInternal(new HoverClickSounds()); AddInternal(new HoverClickSounds());