mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 06:12:56 +08:00
Add non-toggle support for showing seek bar in SongProgress.
This commit is contained in:
parent
36c649f965
commit
eb5d334838
@ -38,9 +38,9 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Origin = Anchor.TopLeft,
|
||||
});
|
||||
|
||||
AddStep("Toggle Bar", progress.ToggleBar);
|
||||
AddStep("Toggle Bar", () => progress.AllowSeeking = !progress.AllowSeeking);
|
||||
AddWaitStep(5);
|
||||
AddStep("Toggle Bar", progress.ToggleBar);
|
||||
AddStep("Toggle Bar", () => progress.AllowSeeking = !progress.AllowSeeking);
|
||||
AddWaitStep(2);
|
||||
AddRepeatStep("New Values", displayNewValues, 5);
|
||||
|
||||
|
@ -86,18 +86,28 @@ namespace osu.Game.Screens.Play
|
||||
State = Visibility.Visible;
|
||||
}
|
||||
|
||||
private bool barVisible;
|
||||
private bool allowSeeking;
|
||||
|
||||
public void ToggleBar()
|
||||
public bool AllowSeeking
|
||||
{
|
||||
barVisible = !barVisible;
|
||||
updateBarVisibility();
|
||||
get
|
||||
{
|
||||
return allowSeeking;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (allowSeeking == value) return;
|
||||
|
||||
allowSeeking = value;
|
||||
updateBarVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBarVisibility()
|
||||
{
|
||||
bar.FadeTo(barVisible ? 1 : 0, transition_duration, EasingTypes.In);
|
||||
MoveTo(new Vector2(0, barVisible ? 0 : bottom_bar_height), transition_duration, EasingTypes.In);
|
||||
bar.FadeTo(allowSeeking ? 1 : 0, transition_duration, EasingTypes.In);
|
||||
MoveTo(new Vector2(0, allowSeeking ? 0 : bottom_bar_height), transition_duration, EasingTypes.In);
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
|
Loading…
Reference in New Issue
Block a user