Closed tig closed 1 week ago
The issue doesn't had to do with ContextMenu
_menuBar
been static but due the fact ContextMenu
been initialized with MenuItems
before it's open. My idea is only create the ContextMenu's MenuItems during the call of the Show
method. But when the ContextMenu
is opened the ScrollBar
shortcut Ctrl-G will be replaced by the same keybind of the ContextMenu
. The only way to avoid this is not use keybings that are already being used by others views.
FWIW, we're not too far from being able to replace Menu
with Menuv2
. I just mocked up a quick prototype in the Bars
scenario using this branch as a base https://github.com/gui-cs/Terminal.Gui/pull/3705.
So, investing too much energy in trying to fix ContextMenu
may not be a good use of time.
So, investing too much energy in trying to fix
ContextMenu
may not be a good use of time.
I almost finishing this. Can be used as prove of concept and then remove.
please do checkout that prototype sometime. I just refined it a bit. Kinda cool me thinks.
To repro:
1) Run
Graph View Example Scenario 2) Press
Ctrl-G`Behavior:
Nothing happens
Expected:
Graph cycles to next graph.
Debugging this, I found the Keybindings for the
Top.MenuBar
are polluted with all of the key bindings for the context menu for theTextView
used for the "about" frame.As a result, since
TextView
usesCtrl+G
for Delete All,Ctrl+G
was added as a key binding to the menu. Thus the StatusBar never sees it.This code in
TextView.cs
is creatingMenuItems
.MenuItem
usesMenuBar._menuBar
which is astatic
.This was introduced in @bdisp's
3653