mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
* Fixes #3678. ContextMenu accesses disposed MenuBar. * Preserve always the last menu opened. * Re-added MenuAllClosed event. * Ensures call CleanUp if Application.MouseGrabView hold another MenuBar than the calling one. * Fix unit tests. * Passing the offending object instead of the View type. * Add that to the dictionary to shut respeller up. * Address a few warnings * A question * Just a little more cleanup * Combine these and comment * Slight additional cleanup * More minor cleanup We already know it is null. just make it the else instead of a new condition * Nullable != true ===> is not true * Unconditional break at the top is just a part of the while statement (inverted) * Fixes #3687. ColorPicker isn't respecting the current UI culture. * Fix @dodexahedron erroneous code. * Cleanup comments. --------- Co-authored-by: Brandon Thetford <github@snapsinazfs.com> Co-authored-by: Tig <tig@users.noreply.github.com>
This commit is contained in:
@@ -390,7 +390,8 @@ public class ContextMenuTests (ITestOutputHelper output)
|
||||
Assert.True (Application.OnKeyDown (ContextMenu.DefaultKey));
|
||||
Assert.True (tf.ContextMenu.MenuBar.IsMenuOpen);
|
||||
Assert.True (Application.OnKeyDown (ContextMenu.DefaultKey));
|
||||
Assert.Null (tf.ContextMenu.MenuBar);
|
||||
// The last context menu bar opened is always preserved
|
||||
Assert.NotNull (tf.ContextMenu.MenuBar);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
@@ -1390,7 +1391,8 @@ public class ContextMenuTests (ITestOutputHelper output)
|
||||
Assert.True (tf1.HasFocus);
|
||||
Assert.False (tf2.HasFocus);
|
||||
Assert.Equal (2, win.Subviews.Count);
|
||||
Assert.Null (tf2.ContextMenu.MenuBar);
|
||||
// The last context menu bar opened is always preserved
|
||||
Assert.NotNull (tf2.ContextMenu.MenuBar);
|
||||
Assert.Equal (win.Focused, tf1);
|
||||
Assert.Null (Application.MouseGrabView);
|
||||
Assert.Equal (tf1, Application.MouseEnteredView);
|
||||
@@ -1400,7 +1402,8 @@ public class ContextMenuTests (ITestOutputHelper output)
|
||||
Assert.False (tf1.HasFocus);
|
||||
Assert.True (tf2.HasFocus);
|
||||
Assert.Equal (2, win.Subviews.Count);
|
||||
Assert.Null (tf2.ContextMenu.MenuBar);
|
||||
// The last context menu bar opened is always preserved
|
||||
Assert.NotNull (tf2.ContextMenu.MenuBar);
|
||||
Assert.Equal (win.Focused, tf2);
|
||||
Assert.Null (Application.MouseGrabView);
|
||||
Assert.Equal (tf2, Application.MouseEnteredView);
|
||||
|
||||
Reference in New Issue
Block a user