1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 03:02:56 +08:00

Merge pull request #6106 from EVAST9919/fix-header-dropdown

Fix RankingsHeader dropdown can be clickable when not visible
This commit is contained in:
Dean Herbert 2019-09-14 13:45:06 +09:00 committed by GitHub
commit bc2a1c91a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,6 @@ namespace osu.Game.Overlays.Rankings
public class RankingsHeader : CompositeDrawable
{
private const int content_height = 250;
private const int dropdown_height = 50;
public IEnumerable<Spotlight> Spotlights
{
@ -31,7 +30,6 @@ namespace osu.Game.Overlays.Rankings
public readonly Bindable<Country> Country = new Bindable<Country>();
public readonly Bindable<Spotlight> Spotlight = new Bindable<Spotlight>();
private readonly Container dropdownPlaceholder;
private readonly OsuDropdown<Spotlight> dropdown;
public RankingsHeader()
@ -86,19 +84,13 @@ namespace osu.Game.Overlays.Rankings
Scope = { BindTarget = Scope },
Country = { BindTarget = Country },
},
dropdownPlaceholder = new Container
dropdown = new OsuDropdown<Spotlight>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
Height = dropdown_height,
Width = 0.8f,
AlwaysPresent = true,
Child = dropdown = new OsuDropdown<Spotlight>
{
RelativeSizeAxes = Axes.X,
Current = Spotlight,
}
Current = Spotlight,
}
}
},
@ -115,7 +107,7 @@ namespace osu.Game.Overlays.Rankings
}
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope) =>
dropdownPlaceholder.FadeTo(scope.NewValue == RankingsScope.Spotlights ? 1 : 0, 200, Easing.OutQuint);
dropdown.FadeTo(scope.NewValue == RankingsScope.Spotlights ? 1 : 0, 200, Easing.OutQuint);
private class HeaderBackground : Sprite
{