Skip to content

Conversation

@Icekey
Copy link
Contributor

@Icekey Icekey commented Jul 18, 2025

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.

@github-actions
Copy link

Preview available at https://egui-pr-preview.github.io/pr/7372-fixid
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@lucasmerlin lucasmerlin added feature New feature or request egui labels Jul 22, 2025
Copy link
Collaborator

@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Icekey
Copy link
Contributor Author

Icekey commented Jul 26, 2025

How does merging work?

@lucasmerlin
Copy link
Collaborator

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.

@emilk emilk changed the title added global_scope flag to UiBuilder Add UiBuilder::global_scope and UiBuilder::id Aug 5, 2025
@emilk emilk merged commit e9afd3c into emilk:main Aug 5, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

egui feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sizing problem with CollapsingHeader in dnd

3 participants