mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Use relative sizing for MonthDropdown
This commit is contained in:
parent
1c0b0996cf
commit
c2ba16f977
@ -22,46 +22,35 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
[Test]
|
[Test]
|
||||||
public void CreateClosedMonthPanel()
|
public void CreateClosedMonthPanel()
|
||||||
{
|
{
|
||||||
AddStep("Create", () => Child = new Container
|
create(false);
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = colourProvider.Background2,
|
|
||||||
},
|
|
||||||
new MonthDropdown(posts),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void CreateOpenMonthPanel()
|
public void CreateOpenMonthPanel()
|
||||||
{
|
{
|
||||||
AddStep("Create", () => Child = new Container
|
create(true);
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = colourProvider.Background2,
|
|
||||||
},
|
|
||||||
new MonthDropdown(posts)
|
|
||||||
{
|
|
||||||
IsOpen = { Value = true }
|
|
||||||
},
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void create(bool isOpen) => AddStep("Create", () => Child = new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Width = 160,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = colourProvider.Background2,
|
||||||
|
},
|
||||||
|
new MonthDropdown(posts)
|
||||||
|
{
|
||||||
|
IsOpen = { Value = isOpen }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
private static List<APINewsPost> posts => new List<APINewsPost>
|
private static List<APINewsPost> posts => new List<APINewsPost>
|
||||||
{
|
{
|
||||||
new APINewsPost
|
new APINewsPost
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.News.Sidebar
|
|||||||
|
|
||||||
public MonthDropdown(IEnumerable<APINewsPost> posts)
|
public MonthDropdown(IEnumerable<APINewsPost> posts)
|
||||||
{
|
{
|
||||||
Width = 160;
|
RelativeSizeAxes = Axes.X;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
InternalChild = new FillFlowContainer
|
InternalChild = new FillFlowContainer
|
||||||
{
|
{
|
||||||
|
@ -42,17 +42,17 @@ namespace osu.Game.Overlays.News.Sidebar
|
|||||||
},
|
},
|
||||||
Child = new FillFlowContainer
|
Child = new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
AutoSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
Spacing = new Vector2(0, 20),
|
Spacing = new Vector2(0, 20),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new YearsPanel(),
|
new YearsPanel(),
|
||||||
monthsFlow = new FillFlowContainer<MonthDropdown>
|
monthsFlow = new FillFlowContainer<MonthDropdown>
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Y,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 10)
|
Spacing = new Vector2(0, 10)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user