mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 23:12:55 +08:00
dropdown-like animation
This commit is contained in:
parent
f2af31aceb
commit
c3647e4056
@ -13,7 +13,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public abstract class SettingsContainer : Container
|
public abstract class SettingsContainer : Container
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The title of this option.
|
/// The title of this container.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract string Title { get; }
|
public abstract string Title { get; }
|
||||||
|
|
||||||
@ -82,6 +82,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
|
AutoSizeDuration = transition_duration,
|
||||||
|
AutoSizeEasing = EasingTypes.OutQuint,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Padding = new MarginPadding(15),
|
Padding = new MarginPadding(15),
|
||||||
@ -106,9 +108,15 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
button.FadeColour(buttonIsPressed ? OsuColour.FromHex(@"ffcc22") : Color4.White, 200, EasingTypes.OutQuint);
|
button.FadeColour(buttonIsPressed ? OsuColour.FromHex(@"ffcc22") : Color4.White, 200, EasingTypes.OutQuint);
|
||||||
|
|
||||||
if (buttonIsPressed)
|
if (buttonIsPressed)
|
||||||
content.Show();
|
{
|
||||||
|
content.ClearTransforms();
|
||||||
|
content.AutoSizeAxes = Axes.Y;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
content.Hide();
|
{
|
||||||
|
content.AutoSizeAxes = Axes.None;
|
||||||
|
content.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user