mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 17:52:56 +08:00
Expand toolbox component items on hover
This commit is contained in:
parent
fdb411c0f3
commit
e4a6b7ae91
@ -109,6 +109,9 @@ namespace osu.Game.Skinning.Editor
|
|||||||
|
|
||||||
private Container innerContainer;
|
private Container innerContainer;
|
||||||
|
|
||||||
|
private const float contracted_size = 60;
|
||||||
|
private const float expanded_size = 120;
|
||||||
|
|
||||||
public ToolboxComponentButton(Drawable component)
|
public ToolboxComponentButton(Drawable component)
|
||||||
{
|
{
|
||||||
this.component = component;
|
this.component = component;
|
||||||
@ -116,7 +119,19 @@ namespace osu.Game.Skinning.Editor
|
|||||||
Enabled.Value = true;
|
Enabled.Value = true;
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X;
|
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]
|
[BackgroundDependencyLoader]
|
||||||
|
Loading…
Reference in New Issue
Block a user