Fixes #2213. ContextMenu.IsShow is wrongly inheriting previous value on a new instance.

This commit is contained in:
BDisp
2022-11-10 17:14:45 +00:00
parent f256ba813e
commit 4b8917a08d

View File

@@ -52,7 +52,10 @@ namespace Terminal.Gui {
public ContextMenu (int x, int y, MenuBarItem menuItems)
{
if (IsShow) {
Hide ();
if (menuBar.SuperView != null) {
Hide ();
}
IsShow = false;
}
MenuItems = menuItems;
Position = new Point (x, y);
@@ -126,7 +129,7 @@ namespace Terminal.Gui {
} else if (ForceMinimumPosToZero && position.Y < 0) {
position.Y = 0;
}
menuBar = new MenuBar (new [] { MenuItems }) {
X = position.X,
Y = position.Y,