Make the tooltips width be dyanmic with the content, so the long text wont occurs wierd line break

This commit is contained in:
normalid 2024-07-28 16:26:18 +08:00
parent 5db0e36404
commit 4e65944609
2 changed files with 10 additions and 10 deletions

View File

@ -24,8 +24,7 @@ namespace osu.Game.Overlays.Mods
{
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(7),
Children = new Drawable[]

View File

@ -23,8 +23,7 @@ namespace osu.Game.Overlays.Mods
public ModPresetTooltip(OverlayColourProvider colourProvider)
{
Width = 250;
AutoSizeAxes = Axes.Y;
AutoSizeAxes = Axes.Both;
Masking = true;
CornerRadius = 7;
@ -38,18 +37,16 @@ namespace osu.Game.Overlays.Mods
},
Content = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 },
Spacing = new Vector2(7),
Children = new[]
{
descriptionText = new TruncatingSpriteText
descriptionText = new OsuSpriteText
{
RelativeSizeAxes = Axes.X,
Font = OsuFont.GetFont(weight: FontWeight.Regular),
Colour = colourProvider.Content1,
AllowMultiline = true,
},
}
}
@ -68,7 +65,11 @@ namespace osu.Game.Overlays.Mods
lastPreset = preset;
Content.RemoveAll(d => d is ModPresetRow, true);
Content.AddRange(preset.Mods.AsOrdered().Select(mod => new ModPresetRow(mod)));
Content.AddRange(preset.Mods.AsOrdered().Select(mod => new ModPresetRow(mod)
{
RelativeSizeAxes = Axes.None,
AutoSizeAxes = Axes.Both,
}));
}
protected override void PopIn() => this.FadeIn(transition_duration, Easing.OutQuint);