1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 11:03:05 +08:00

Make the filter autosized

This commit is contained in:
Andrei Zavatski 2020-02-16 15:04:21 +03:00
parent 3888911eee
commit a71e410e5d
2 changed files with 4 additions and 20 deletions

View File

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -25,16 +24,13 @@ namespace osu.Game.Tests.Visual.UserInterface
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
private readonly FillFlowContainer resizableContainer;
public TestSceneBeatmapSearchFilter()
{
Add(resizableContainer = new FillFlowContainer
Add(new FillFlowContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Y,
Width = 600,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 10),
Children = new Drawable[]
@ -44,12 +40,5 @@ namespace osu.Game.Tests.Visual.UserInterface
}
});
}
[Test]
public void TestResize()
{
AddStep("Resize to 100px", () => resizableContainer.ResizeWidthTo(100, 1000));
AddStep("Resize to 600px", () => resizableContainer.ResizeWidthTo(600, 1000));
}
}
}

View File

@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.BeatmapListing
{
@ -20,8 +19,7 @@ namespace osu.Game.Overlays.BeatmapListing
{
public BeatmapSearchFilter()
{
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Both;
if (typeof(T).IsEnum)
{
@ -36,11 +34,8 @@ namespace osu.Game.Overlays.BeatmapListing
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Full,
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(10),
AllowMultiline = true,
};
protected class FilterTabItem : TabItem<T>