From 3d08bc5605242c097531eae2945a89abe7f80955 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Wed, 14 Feb 2024 23:00:30 -0800 Subject: [PATCH] Truncate long dropdown menu item text and show tooltip --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 2dc701dc9d..38e90bf4ea 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -186,6 +186,8 @@ namespace osu.Game.Graphics.UserInterface : base(item) { Foreground.Padding = new MarginPadding(2); + Foreground.AutoSizeAxes = Axes.Y; + Foreground.RelativeSizeAxes = Axes.X; Masking = true; CornerRadius = corner_radius; @@ -247,11 +249,12 @@ namespace osu.Game.Graphics.UserInterface Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, - Label = new OsuSpriteText + Label = new TruncatingSpriteText { - X = 15, + Padding = new MarginPadding { Left = 15 }, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, + RelativeSizeAxes = Axes.X, }, }; }