1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Add background colour to music player ProgressBar (#6741)

Add background colour to music player ProgressBar
This commit is contained in:
Dean Herbert 2019-11-06 17:44:08 +09:00 committed by GitHub
commit 09e9ef0e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,12 +168,13 @@ namespace osu.Game.Overlays
},
}
},
progressBar = new ProgressBar
progressBar = new HoverableProgressBar
{
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
Height = progress_height,
Height = progress_height / 2,
FillColour = colours.Yellow,
BackgroundColour = colours.YellowDarker.Opacity(0.5f),
OnSeek = musicController.SeekTo
}
},
@ -401,5 +402,20 @@ namespace osu.Game.Overlays
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);
}
}
}
}