mirror of
https://github.com/ppy/osu.git
synced 2025-03-06 05:53:11 +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();
|
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;
|
Action = Expanded.Toggle;
|
||||||
Enabled.Value = false;
|
Enabled.Value = false;
|
||||||
}
|
}
|
||||||
@ -113,7 +114,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
if (Enabled.Value)
|
if (Enabled.Value)
|
||||||
{
|
{
|
||||||
if (!touchedThisFrame)
|
if (!touchedThisFrame)
|
||||||
Parent?.UpdateHoverExpansion(true);
|
panel.UpdateHoverExpansion(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.OnHover(e);
|
return base.OnHover(e);
|
||||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new ModCustomisationHeader
|
new ModCustomisationHeader(this)
|
||||||
{
|
{
|
||||||
Depth = float.MinValue,
|
Depth = float.MinValue,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
Enabled = { BindTarget = Enabled },
|
Enabled = { BindTarget = Enabled },
|
||||||
Expanded = { BindTarget = Expanded },
|
Expanded = { BindTarget = Expanded },
|
||||||
},
|
},
|
||||||
content = new FocusGrabbingContainer
|
content = new FocusGrabbingContainer(this)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
BorderColour = colourProvider.Dark3,
|
BorderColour = colourProvider.Dark3,
|
||||||
@ -229,12 +229,17 @@ namespace osu.Game.Overlays.Mods
|
|||||||
public override bool RequestsFocus => Expanded.Value;
|
public override bool RequestsFocus => Expanded.Value;
|
||||||
public override bool AcceptsFocus => 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)
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
{
|
{
|
||||||
if (ExpandedByHovering.Value && !ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
|
if (ExpandedByHovering.Value && !ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
|
||||||
Parent?.UpdateHoverExpansion(false);
|
panel.UpdateHoverExpansion(false);
|
||||||
|
|
||||||
base.OnHoverLost(e);
|
base.OnHoverLost(e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user