From a71e410e5d622bba24979f76e9eed58230601260 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 16 Feb 2020 15:04:21 +0300 Subject: [PATCH] Make the filter autosized --- .../UserInterface/TestSceneBeatmapSearchFilter.cs | 15 ++------------- .../BeatmapListing/BeatmapSearchFilter.cs | 9 ++------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapSearchFilter.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapSearchFilter.cs index e25b047fd0..a237a8a5b5 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapSearchFilter.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapSearchFilter.cs @@ -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)); - } } } diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilter.cs b/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilter.cs index bf9d48fa3e..6cd941495f 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilter.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilter.cs @@ -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