Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContextMenu pollutes Toplevel.MenuBar's key bindings #3700

Closed
tig opened this issue Aug 28, 2024 · 4 comments · Fixed by #3709
Closed

ContextMenu pollutes Toplevel.MenuBar's key bindings #3700

tig opened this issue Aug 28, 2024 · 4 comments · Fixed by #3709
Assignees
Labels
Milestone

Comments

@tig
Copy link
Collaborator

tig commented Aug 28, 2024

To repro:

  1. Run `Graph View Example Scenario
  2. Press Ctrl-G

Behavior:

Nothing happens

Expected:

Graph cycles to next graph.

image

Debugging this, I found the Keybindings for the Top.MenuBar are polluted with all of the key bindings for the context menu for the TextView used for the "about" frame.

As a result, since TextView uses Ctrl+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 creating MenuItems.

image

MenuItem uses MenuBar._menuBar which is a static.

This was introduced in @BDisp's

@tig tig added the bug label Aug 28, 2024
@tig tig added this to the V2 Beta milestone Aug 28, 2024
@BDisp
Copy link
Collaborator

BDisp commented Aug 30, 2024

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.

@tig
Copy link
Collaborator Author

tig commented Aug 30, 2024

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 #3705.

ZI4aRMC 1

So, investing too much energy in trying to fix ContextMenu may not be a good use of time.

@BDisp
Copy link
Collaborator

BDisp commented Aug 30, 2024

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.

@tig
Copy link
Collaborator Author

tig commented Aug 30, 2024

please do checkout that prototype sometime. I just refined it a bit. Kinda cool me thinks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants