1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +08:00

Fix RankingsHeader dropdown can be clickable when not visible

This commit is contained in:
Andrei Zavatski 2019-09-14 06:16:25 +03:00
parent ac6fffd834
commit 8ad782a82d

View File

@ -31,7 +31,6 @@ namespace osu.Game.Overlays.Rankings
public readonly Bindable<Country> Country = new Bindable<Country>(); public readonly Bindable<Country> Country = new Bindable<Country>();
public readonly Bindable<Spotlight> Spotlight = new Bindable<Spotlight>(); public readonly Bindable<Spotlight> Spotlight = new Bindable<Spotlight>();
private readonly Container dropdownPlaceholder;
private readonly OsuDropdown<Spotlight> dropdown; private readonly OsuDropdown<Spotlight> dropdown;
public RankingsHeader() public RankingsHeader()
@ -86,14 +85,13 @@ namespace osu.Game.Overlays.Rankings
Scope = { BindTarget = Scope }, Scope = { BindTarget = Scope },
Country = { BindTarget = Country }, Country = { BindTarget = Country },
}, },
dropdownPlaceholder = new Container new Container
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = dropdown_height, Height = dropdown_height,
Width = 0.8f, Width = 0.8f,
AlwaysPresent = true,
Child = dropdown = new OsuDropdown<Spotlight> Child = dropdown = new OsuDropdown<Spotlight>
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -115,7 +113,7 @@ namespace osu.Game.Overlays.Rankings
} }
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope) => 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 private class HeaderBackground : Sprite
{ {