mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Fix overlay toggle keys working during disabled activation modes
Closes #23104.
This commit is contained in:
parent
daf9f19b29
commit
a097433cb1
@ -114,6 +114,19 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(OverlayActivation.All)]
|
||||||
|
[TestCase(OverlayActivation.Disabled)]
|
||||||
|
public void TestButtonKeyboardInputRespectsOverlayActivation(OverlayActivation mode)
|
||||||
|
{
|
||||||
|
AddStep($"set activation mode to {mode}", () => toolbar.OverlayActivationMode.Value = mode);
|
||||||
|
AddStep("hide toolbar", () => toolbar.Hide());
|
||||||
|
|
||||||
|
if (mode == OverlayActivation.Disabled)
|
||||||
|
AddAssert("check buttons not accepting input", () => InputManager.NonPositionalInputQueue.OfType<ToolbarButton>().Count(), () => Is.Zero);
|
||||||
|
else
|
||||||
|
AddAssert("check buttons accepting input", () => InputManager.NonPositionalInputQueue.OfType<ToolbarButton>().Count(), () => Is.Not.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
[TestCase(OverlayActivation.All)]
|
[TestCase(OverlayActivation.All)]
|
||||||
[TestCase(OverlayActivation.Disabled)]
|
[TestCase(OverlayActivation.Disabled)]
|
||||||
public void TestRespectsOverlayActivation(OverlayActivation mode)
|
public void TestRespectsOverlayActivation(OverlayActivation mode)
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||||
|
|
||||||
// Toolbar and its components need keyboard input even when hidden.
|
// Toolbar and its components need keyboard input even when hidden.
|
||||||
public override bool PropagateNonPositionalInputSubTree => true;
|
public override bool PropagateNonPositionalInputSubTree => OverlayActivationMode.Value != OverlayActivation.Disabled;
|
||||||
|
|
||||||
public Toolbar()
|
public Toolbar()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user