-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add UiBuilder::global_scope and UiBuilder::id
#7372
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
|
Preview available at https://egui-pr-preview.github.io/pr/7372-fixid |
lucasmerlin
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.
Nice!
|
How does merging work? |
|
I usually go through all approved PRs with @emilk every tuesday, but hes on holiday right now so it'll have to wait until next tuesday. |
UiBuilder::global_scope and UiBuilder::id
I added a new flag to the UiBuilder so that it is possible to move child widgets around the ui tree without losing state information.
Currently there is no way to create child widgets with the same id at different locations in the ui tree since ids change in relation the the parent id. With the new flag a unique global scope can be created which always results in the same ids even at different locations.
You still need to ensure that the widgets only get rendered once in frame.
This feature can be used to fix a issue i am having with the https://github.com/lucasmerlin/hello_egui crate.