-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Standard widgets: Popover and Menu. #21636
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
Conversation
examples/ui/standard_widgets.rs
Outdated
| observe(on_menu_event), | ||
| children![( | ||
| Node { | ||
| width: Val::Px(200.0), |
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.
Given this is an example, where I expect to see idiomatic code, shouldn't the convenience functions (px, percent, px(n).all()) be used here and not Val directly?
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.
Replaced uses of Val.
|
The way this component is named |
"Select" is a different widget:
Both are in the class of "popups" and "dropdowns". You can easily build a select from a menu:
|
isHavvy
left a comment
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.
(Approving only for my nit, not the whole thing)
ickshonpe
left a comment
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've only had a quick look, but I don't see any obvious problems with the implementation, and the menu in the example works nicely.
| ) | ||
| ), | ||
| menu_button(asset_server), | ||
| Text::new("Press 'D' to toggle widget disabled states"), |
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.
Pressing "D" doesn't disable the menu, don't know if that's intended or not.
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 added code to disable the button, although I didn't add code to change the menu button color when disabled, but you can see that when disabled the menu does not pop up.
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
Co-authored-by: Viktor Gustavsson <villor94@gmail.com>
Objective
Solution
Testing
Showcase