diff --git a/osu.Game/Overlays/Mods/ModPresetColumn.cs b/osu.Game/Overlays/Mods/ModPresetColumn.cs index 3b12eec195..0803389f45 100644 --- a/osu.Game/Overlays/Mods/ModPresetColumn.cs +++ b/osu.Game/Overlays/Mods/ModPresetColumn.cs @@ -26,6 +26,8 @@ namespace osu.Game.Overlays.Mods [Resolved] private IBindable ruleset { get; set; } = null!; + private const float contracted_width = WIDTH - 120; + [BackgroundDependencyLoader] private void load(OsuColour colours) { @@ -42,6 +44,8 @@ namespace osu.Game.Overlays.Mods base.LoadComplete(); ruleset.BindValueChanged(_ => rulesetChanged(), true); + + Width = contracted_width; } private IDisposable? presetSubscription; @@ -65,7 +69,11 @@ namespace osu.Game.Overlays.Mods { cancellationTokenSource?.Cancel(); - if (!presets.Any()) + bool hasPresets = presets.Any(); + + this.ResizeWidthTo(hasPresets ? WIDTH : contracted_width, 200, Easing.OutQuint); + + if (!hasPresets) { removeAndDisposePresetPanels(); return; diff --git a/osu.Game/Overlays/Mods/ModSelectColumn.cs b/osu.Game/Overlays/Mods/ModSelectColumn.cs index 338ebdaef4..1c56763bd9 100644 --- a/osu.Game/Overlays/Mods/ModSelectColumn.cs +++ b/osu.Game/Overlays/Mods/ModSelectColumn.cs @@ -61,9 +61,11 @@ namespace osu.Game.Overlays.Mods private const float header_height = 42; + protected const float WIDTH = 320; + protected ModSelectColumn() { - Width = 320; + Width = WIDTH; RelativeSizeAxes = Axes.Y; Shear = new Vector2(ShearedOverlayContainer.SHEAR, 0);