mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 07:32:55 +08:00
pass ModCustomisationPanel
through ctor
This commit is contained in:
parent
5fb364cad6
commit
188ddbcad6
@ -29,10 +29,11 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
public readonly BindableBool Expanded = new BindableBool();
|
||||
|
||||
protected new ModCustomisationPanel? Parent => (ModCustomisationPanel?)base.Parent;
|
||||
private readonly ModCustomisationPanel panel;
|
||||
|
||||
public ModCustomisationHeader()
|
||||
public ModCustomisationHeader(ModCustomisationPanel panel)
|
||||
{
|
||||
this.panel = panel;
|
||||
Action = Expanded.Toggle;
|
||||
Enabled.Value = false;
|
||||
}
|
||||
@ -113,7 +114,7 @@ namespace osu.Game.Overlays.Mods
|
||||
if (Enabled.Value)
|
||||
{
|
||||
if (!touchedThisFrame)
|
||||
Parent?.UpdateHoverExpansion(true);
|
||||
panel.UpdateHoverExpansion(true);
|
||||
}
|
||||
|
||||
return base.OnHover(e);
|
||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new ModCustomisationHeader
|
||||
new ModCustomisationHeader(this)
|
||||
{
|
||||
Depth = float.MinValue,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Mods
|
||||
Enabled = { BindTarget = Enabled },
|
||||
Expanded = { BindTarget = Expanded },
|
||||
},
|
||||
content = new FocusGrabbingContainer
|
||||
content = new FocusGrabbingContainer(this)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
BorderColour = colourProvider.Dark3,
|
||||
@ -229,12 +229,17 @@ namespace osu.Game.Overlays.Mods
|
||||
public override bool RequestsFocus => Expanded.Value;
|
||||
public override bool AcceptsFocus => Expanded.Value;
|
||||
|
||||
public new ModCustomisationPanel? Parent => (ModCustomisationPanel?)base.Parent;
|
||||
private readonly ModCustomisationPanel panel;
|
||||
|
||||
public FocusGrabbingContainer(ModCustomisationPanel panel)
|
||||
{
|
||||
this.panel = panel;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
if (ExpandedByHovering.Value && !ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
|
||||
Parent?.UpdateHoverExpansion(false);
|
||||
panel.UpdateHoverExpansion(false);
|
||||
|
||||
base.OnHoverLost(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user