mirror of https://github.com/ppy/osu
Consume ValueChanged and inline some pointless constants
This commit is contained in:
parent
1e4f3507ed
commit
031f0ee1e7
|
@ -19,8 +19,6 @@ public class RankingsHeader : CompositeDrawable
|
|||
{
|
||||
private const int content_height = 250;
|
||||
private const int dropdown_height = 50;
|
||||
private const int spacing = 20;
|
||||
private const int duration = 200;
|
||||
|
||||
public IEnumerable<Spotlight> Spotlights
|
||||
{
|
||||
|
@ -72,7 +70,7 @@ public RankingsHeader()
|
|||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, spacing),
|
||||
Spacing = new Vector2(0, 20),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new RankingsScopeSelector
|
||||
|
@ -112,12 +110,12 @@ public RankingsHeader()
|
|||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
Scope.BindValueChanged(scope => onScopeChanged(scope.NewValue), true);
|
||||
Scope.BindValueChanged(onScopeChanged, true);
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
private void onScopeChanged(RankingsScope scope) =>
|
||||
dropdownPlaceholder.FadeTo(scope == RankingsScope.Spotlights ? 1 : 0, duration, Easing.OutQuint);
|
||||
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope) =>
|
||||
dropdownPlaceholder.FadeTo(scope.NewValue == RankingsScope.Spotlights ? 1 : 0, 200, Easing.OutQuint);
|
||||
|
||||
private class HeaderBackground : Sprite
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue