mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 00:43:21 +08:00
Merge pull request #24796 from peppy/collapse-preset-column
Collapse mod presets column slightly when not in use
This commit is contained in:
commit
2d3be819d0
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user