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:
commit
bc2a1c91a1
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user