mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
Merge branch 'v2_develop' into v2_3750-MouseEnter
This commit is contained in:
@@ -101,7 +101,7 @@ internal sealed class Menu : View
|
||||
|
||||
for (var i = 0; i < _barItems.Children?.Length; i++)
|
||||
{
|
||||
if (_barItems.Children [i]!.IsEnabled ())
|
||||
if (_barItems.Children [i]?.IsEnabled () == true)
|
||||
{
|
||||
_currentChild = i;
|
||||
|
||||
|
||||
@@ -148,6 +148,30 @@ public class MenuBarTests (ITestOutputHelper output)
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
public void CanExecute_False_Does_Not_Throws ()
|
||||
{
|
||||
var menu = new MenuBar
|
||||
{
|
||||
Menus =
|
||||
[
|
||||
new ("File", new MenuItem []
|
||||
{
|
||||
new ("New", "", null, () => false),
|
||||
null,
|
||||
new ("Quit", "", null)
|
||||
})
|
||||
]
|
||||
};
|
||||
var top = new Toplevel ();
|
||||
top.Add (menu);
|
||||
Application.Begin (top);
|
||||
|
||||
Assert.True (menu.NewKeyDownEvent (menu.Key));
|
||||
Assert.True (menu.IsMenuOpen);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
public void CanExecute_HotKey ()
|
||||
|
||||
Reference in New Issue
Block a user