mirror of
https://github.com/ppy/osu
synced 2024-12-25 00:02:48 +00: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.Disabled)]
|
||||
public void TestRespectsOverlayActivation(OverlayActivation mode)
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
|
||||
// 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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user