whiskers
whiskers copied to clipboard
Use MenuButton instead of custom controls
Currently the menu bar buttons use custom controls to achieve a similar behavior to MenuButton.
Here's how the MenuButton looks like in the Godot editor:

We should consider using the MenuButton node because it would:
- Simplify the tree scene (the addition of menu items is done through code)
- Ease the handling of shortcuts (MenuButton uses a PopupMenu which allows to specify a ShortCut to each item)
- Remove the need to manage the opening and closing of each menu (it's handled by default)
- Allow to use the
switch_on_hoverproperty
The only caveat is that there's currently an issue that hides a menu item label when a shortcut is set.
Thoughts?
I agree that we should switch to MenuButton, however that bug you linked looks like it could cause some headaches, and isn't slated to be fixed until 3.2 which is a little concerning.
I'm curious if there is an easy workaround so that we can switch to the MenuButton button nodes and still add shortcuts. I also wonder if the bug is only in effect when programmatically adding items / labels?