mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 20:53:04 +08:00
Make the filter autosized
This commit is contained in:
parent
3888911eee
commit
a71e410e5d
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -25,16 +24,13 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[Cached]
|
[Cached]
|
||||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||||
|
|
||||||
private readonly FillFlowContainer resizableContainer;
|
|
||||||
|
|
||||||
public TestSceneBeatmapSearchFilter()
|
public TestSceneBeatmapSearchFilter()
|
||||||
{
|
{
|
||||||
Add(resizableContainer = new FillFlowContainer
|
Add(new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Both,
|
||||||
Width = 600,
|
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 10),
|
Spacing = new Vector2(0, 10),
|
||||||
Children = new Drawable[]
|
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.BeatmapListing
|
namespace osu.Game.Overlays.BeatmapListing
|
||||||
{
|
{
|
||||||
@ -20,8 +19,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
{
|
{
|
||||||
public BeatmapSearchFilter()
|
public BeatmapSearchFilter()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Both;
|
||||||
RelativeSizeAxes = Axes.X;
|
|
||||||
|
|
||||||
if (typeof(T).IsEnum)
|
if (typeof(T).IsEnum)
|
||||||
{
|
{
|
||||||
@ -36,11 +34,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
|
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Both,
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Direction = FillDirection.Full,
|
|
||||||
Spacing = new Vector2(10),
|
Spacing = new Vector2(10),
|
||||||
AllowMultiline = true,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
protected class FilterTabItem : TabItem<T>
|
protected class FilterTabItem : TabItem<T>
|
||||||
|
Loading…
Reference in New Issue
Block a user