-
Notifications
You must be signed in to change notification settings - Fork 638
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
Document MenuBar and ContextMenu #7502
Conversation
a5a1c59
to
332d4cf
Compare
332d4cf
to
b3b7c37
Compare
|
||
### show(Point) | ||
|
||
Call this function to programmatically show the context menu at the given position relative to the `ContextMenu` element. |
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 have the feeling that we might revisit these semantics in the API review ;-)
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.
ok, feel free to let me know what feels wrong there.
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.
My guts feeling is that we may be better off accepting absolute coordinates, to disambiguate the API.
The relative coordinates make sense when ContextMenu
surrounds the area that provides the context menu, but I'm not sure one would call show()
then and instead rely on the automatic support for the right click?
And when it's not surrounding, the relative coordinates require additional steps:
ctx := ContextMenu { MenuItem { ... } MenuItem { ... } }
canvas := SomeCanvasOfThings {
something-selected-via-right-click(pos) => {
ctx.show({x: pos.x - canvas.x + ctx.x, y: pos.y - canvas.y + ctx.y}); // Is this correct?
}
}
As opposed to just taking absolute coordinates:
ctx := ContextMenu { MenuItem { ... } MenuItem { ... } }
canvas := SomeCanvasOfThings {
something-selected-via-right-click(pos) => {
ctx.show({x: pos.x + canvas.absolute-position.x, y: pos.y + canvas.absolute-position.y});
}
}
Apply suggestions from code review Co-authored-by: Simon Hausmann <[email protected]>
And don't mark them as experimental.
Which also enable the muda dependency by default on mac and windows