1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

Truncate long dropdown menu item text and show tooltip

This commit is contained in:
Joseph Madamba 2024-02-14 23:00:30 -08:00
parent 401bd91dc4
commit 3d08bc5605

View File

@ -186,6 +186,8 @@ namespace osu.Game.Graphics.UserInterface
: base(item) : base(item)
{ {
Foreground.Padding = new MarginPadding(2); Foreground.Padding = new MarginPadding(2);
Foreground.AutoSizeAxes = Axes.Y;
Foreground.RelativeSizeAxes = Axes.X;
Masking = true; Masking = true;
CornerRadius = corner_radius; CornerRadius = corner_radius;
@ -247,11 +249,12 @@ namespace osu.Game.Graphics.UserInterface
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
}, },
Label = new OsuSpriteText Label = new TruncatingSpriteText
{ {
X = 15, Padding = new MarginPadding { Left = 15 },
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
}, },
}; };
} }