mirror of https://github.com/ppy/osu
Add corner rounding and positional transform
This commit is contained in:
parent
7253866e17
commit
454e94574c
|
@ -27,28 +27,40 @@ public class ModSettingsContainer : VisibilityContainer
|
||||||
|
|
||||||
private readonly FillFlowContainer<ModControlSection> modSettingsContent;
|
private readonly FillFlowContainer<ModControlSection> modSettingsContent;
|
||||||
|
|
||||||
private const double transition_duration = 200;
|
private readonly Container content;
|
||||||
|
|
||||||
|
private const double transition_duration = 400;
|
||||||
|
|
||||||
public ModSettingsContainer()
|
public ModSettingsContainer()
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
Child = content = new Container
|
||||||
{
|
{
|
||||||
new Box
|
Masking = true,
|
||||||
|
CornerRadius = 10,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
RelativePositionAxes = Axes.Both,
|
||||||
|
X = 1,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
new Box
|
||||||
Colour = new Color4(0, 0, 0, 192)
|
|
||||||
},
|
|
||||||
new OsuScrollContainer
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Child = modSettingsContent = new FillFlowContainer<ModControlSection>
|
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.TopCentre,
|
Colour = new Color4(0, 0, 0, 192)
|
||||||
RelativeSizeAxes = Axes.X,
|
},
|
||||||
AutoSizeAxes = Axes.Y,
|
new OsuScrollContainer
|
||||||
Spacing = new Vector2(0f, 10f),
|
{
|
||||||
Padding = new MarginPadding(20),
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Child = modSettingsContent = new FillFlowContainer<ModControlSection>
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Spacing = new Vector2(0f, 10f),
|
||||||
|
Padding = new MarginPadding(20),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -86,11 +98,13 @@ private void modsChanged(ValueChangedEvent<IReadOnlyList<Mod>> mods)
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
this.FadeIn(transition_duration, Easing.OutQuint);
|
this.FadeIn(transition_duration, Easing.OutQuint);
|
||||||
|
content.MoveToX(0, transition_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
this.FadeOut(transition_duration, Easing.OutQuint);
|
this.FadeOut(transition_duration, Easing.OutQuint);
|
||||||
|
content.MoveToX(1, transition_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue