1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Expand toolbox component items on hover

This commit is contained in:
Dean Herbert 2022-03-15 17:33:06 +09:00
parent fdb411c0f3
commit e4a6b7ae91

View File

@ -109,6 +109,9 @@ namespace osu.Game.Skinning.Editor
private Container innerContainer;
private const float contracted_size = 60;
private const float expanded_size = 120;
public ToolboxComponentButton(Drawable component)
{
this.component = component;
@ -116,7 +119,19 @@ namespace osu.Game.Skinning.Editor
Enabled.Value = true;
RelativeSizeAxes = Axes.X;
Height = 60;
Height = contracted_size;
}
protected override bool OnHover(HoverEvent e)
{
this.Delay(300).ResizeHeightTo(expanded_size, 500, Easing.OutQuint);
return base.OnHover(e);
}
protected override void OnHoverLost(HoverLostEvent e)
{
base.OnHoverLost(e);
this.ResizeHeightTo(contracted_size, 500, Easing.OutQuint);
}
[BackgroundDependencyLoader]