mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Fixed ContextMenu
This commit is contained in:
@@ -591,7 +591,7 @@ public partial class View // Keyboard APIs
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool InvokeCommandsBoundToHotKeyOnSubviews (Key key, ref bool? handled, bool invoke = true)
|
||||
internal bool InvokeCommandsBoundToHotKeyOnSubviews (Key key, ref bool? handled, bool invoke = true)
|
||||
{
|
||||
bool? weHandled = InvokeCommandsBoundToKey (key, KeyBindingScope.HotKey);
|
||||
if (weHandled is true)
|
||||
|
||||
@@ -109,9 +109,7 @@ public sealed class ContextMenu : IDisposable
|
||||
_menuBar?.Dispose ();
|
||||
_menuBar = null;
|
||||
IsShow = false;
|
||||
|
||||
Application.KeyBindings.Remove (Key);
|
||||
|
||||
`
|
||||
if (_container is { })
|
||||
{
|
||||
_container.Closing -= Container_Closing;
|
||||
@@ -253,8 +251,6 @@ public sealed class ContextMenu : IDisposable
|
||||
_menuBar._isContextMenuLoading = true;
|
||||
_menuBar.MenuAllClosed += MenuBar_MenuAllClosed;
|
||||
|
||||
Application.KeyBindings.Add (Key, _menuBar, Command.Cancel);
|
||||
|
||||
_menuBar.BeginInit ();
|
||||
_menuBar.EndInit ();
|
||||
IsShow = true;
|
||||
|
||||
@@ -250,7 +250,8 @@ internal sealed class Menu : View
|
||||
protected override bool OnKeyDownNotHandled (Key keyEvent)
|
||||
{
|
||||
// We didn't handle the key, pass it on to host
|
||||
return _host.InvokeCommandsBoundToKey (keyEvent) == true;
|
||||
bool? handled = null;
|
||||
return _host.InvokeCommandsBoundToHotKeyOnSubviews (keyEvent, ref handled, true ) == true;
|
||||
}
|
||||
|
||||
protected override bool OnMouseEvent (MouseEventArgs me)
|
||||
|
||||
Reference in New Issue
Block a user