-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feature: submenus #905
Feature: submenus #905
Conversation
artifact detected … will clean-up |
Okay, I think I will remove it by extra commit :). |
I'm not sure I follow the need for |
You can check the placement on the far right which also shows that submenus are placed left on insufficient space to the right :). |
Fair enough. Can you find a place to put it that does not take up so much space? |
I hoped, you would suggest one :). I’ll have a look. |
Maybe buttons -> Actions and it's added to the bottom of that panel? |
This fixes also a bug which miscalculated the callback item IDs.
The native menu still will trigger an event which should be handled by an appropriate callback.
internal/driver/glfw/menu_darwin.go
Outdated
callbacks = append(callbacks, func() { w.queueEvent(action) }) | ||
nextItemID++ | ||
} | ||
action := item.Action // catch action value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure here, the action is being captured on menu creation so it cannot change - should instead the item be captured so the latest value for Action is used in the callback? I only noticed it as the nil check is on a value that doesn't change.
Just 1 inline comment if you could check it out. I also realised something (from a previous commit I think): macOS apps use "Preferences..." instead of "Settings" in the label - should we be rewriting it, should we move to Preferences or should we check for both? |
Description:
This PR introduces the ability to create menus with submenus.
It also includes:
SelectEntry
to let the pop-up size match the entry size if it changes (like forSelect
)Fixes #395
Checklist:
Where applicable: