mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 00:42:55 +08:00
Merge branch 'master' into fix-debug-perf-drd
This commit is contained in:
commit
7dfd903b76
@ -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