Add non-toggle support for showing seek bar in SongProgress.

This commit is contained in:
Dean Herbert
2017-04-25 19:07:07 +09:00
parent 36c649f965
commit eb5d334838
2 changed files with 18 additions and 8 deletions

View File

@ -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()