Merge pull request #2214 from BDisp/contextmenu.isshow-fix-2213

Fixes #2213. ContextMenu.IsShow is wrongly inheriting previous value on a new instance.
This commit is contained in:
Tig
2022-11-11 11:34:03 -07:00
committed by GitHub

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,