mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Make progress bar hoverable
This commit is contained in:
parent
d985d04857
commit
02c21a1379
@ -168,11 +168,11 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
progressBar = new ProgressBar
|
progressBar = new HoverableProgressBar
|
||||||
{
|
{
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Height = progress_height,
|
Height = progress_height / 2,
|
||||||
FillColour = colours.Yellow,
|
FillColour = colours.Yellow,
|
||||||
BackgroundColour = colours.YellowDarker.Opacity(0.5f),
|
BackgroundColour = colours.YellowDarker.Opacity(0.5f),
|
||||||
OnSeek = musicController.SeekTo
|
OnSeek = musicController.SeekTo
|
||||||
@ -402,5 +402,20 @@ namespace osu.Game.Overlays
|
|||||||
return base.OnDragEnd(e);
|
return base.OnDragEnd(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class HoverableProgressBar : ProgressBar
|
||||||
|
{
|
||||||
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
{
|
||||||
|
this.ResizeHeightTo(progress_height, 500, Easing.OutQuint);
|
||||||
|
return base.OnHover(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
|
{
|
||||||
|
this.ResizeHeightTo(progress_height / 2, 500, Easing.OutQuint);
|
||||||
|
base.OnHoverLost(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user