mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 15:23:14 +08:00
Extract disabling progress bar user-interactivity
This commit is contained in:
parent
4e6c1a3906
commit
bd44bf8c0b
@ -40,8 +40,14 @@ namespace osu.Game.Graphics.UserInterface
|
||||
set => CurrentNumber.Value = value;
|
||||
}
|
||||
|
||||
public ProgressBar()
|
||||
private readonly bool userInteractive;
|
||||
public override bool HandlePositionalInput => userInteractive;
|
||||
public override bool HandleNonPositionalInput => userInteractive;
|
||||
|
||||
public ProgressBar(bool userInteractive)
|
||||
{
|
||||
this.userInteractive = userInteractive;
|
||||
|
||||
CurrentNumber.MinValue = 0;
|
||||
CurrentNumber.MaxValue = 1;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
||||
public DownloadProgressBar(BeatmapSetInfo beatmapSet)
|
||||
: base(beatmapSet)
|
||||
{
|
||||
AddInternal(progressBar = new InteractionDisabledProgressBar
|
||||
AddInternal(progressBar = new ProgressBar(false)
|
||||
{
|
||||
Height = 0,
|
||||
Alpha = 0,
|
||||
@ -64,11 +64,5 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
private class InteractionDisabledProgressBar : ProgressBar
|
||||
{
|
||||
public override bool HandlePositionalInput => false;
|
||||
public override bool HandleNonPositionalInput => false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -411,6 +411,11 @@ namespace osu.Game.Overlays
|
||||
|
||||
private class HoverableProgressBar : ProgressBar
|
||||
{
|
||||
public HoverableProgressBar()
|
||||
: base(true)
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
this.ResizeHeightTo(progress_height, 500, Easing.OutQuint);
|
||||
|
Loading…
Reference in New Issue
Block a user