Partially Fixes #2975 - Upgrades UICatalog to Menuv2 (#4011)

This commit is contained in:
Tig
2025-04-02 06:27:24 -06:00
committed by GitHub
parent 4cc44091f2
commit 7ba9e539ed
31 changed files with 6467 additions and 5216 deletions

View File

@@ -129,6 +129,28 @@ public class KeyBindingsTests ()
top.Dispose ();
}
[Fact]
[AutoInitShutdown]
public void HotKey_Enabled_False_Does_Not_Invoke ()
{
var view = new ScopedKeyBindingView ();
var keyWasHandled = false;
view.KeyDownNotHandled += (s, e) => keyWasHandled = true;
var top = new Toplevel ();
top.Add (view);
Application.Begin (top);
Application.RaiseKeyDownEvent (Key.Z);
Assert.False (keyWasHandled);
Assert.False (view.HotKeyCommand);
keyWasHandled = false;
view.Enabled = false;
Application.RaiseKeyDownEvent (Key.F);
Assert.False (view.HotKeyCommand);
top.Dispose ();
}
// tests that test KeyBindingScope.Focus and KeyBindingScope.HotKey (tests for KeyBindingScope.Application are in Application/KeyboardTests.cs)
public class ScopedKeyBindingView : View