Collapse mod presets column slightly when not in use

This commit is contained in:
Dean Herbert 2023-09-13 17:05:42 +09:00
parent f90f2491c3
commit f5cee22db7
2 changed files with 12 additions and 2 deletions

View File

@ -26,6 +26,8 @@ namespace osu.Game.Overlays.Mods
[Resolved]
private IBindable<RulesetInfo> 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;

View File

@ -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);