mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user