Consume ValueChanged and inline some pointless constants

This commit is contained in:
Dean Herbert 2019-09-13 18:09:15 +09:00
parent 1e4f3507ed
commit 031f0ee1e7
1 changed files with 4 additions and 6 deletions

View File

@ -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
{