Make it more clear how a Ui Id was derived#7988
Make it more clear how a Ui Id was derived#7988lucasmerlin wants to merge 2 commits intolucas/experiments/helpful-id-debugfrom
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/7988-lucasbetter-ui-id-bookkeeping View snapshot changes at kitdiff |
|
I'm not a big fan of that UI. It has A LOT of repetition ( I also think showing all the Ids of all the ancestors is a bit overkill, though I can see how hovering them to find them in the UI would be useful. So I suggest something like this: Id(C4BF): where each row is hoverable, and shows the …actually, turning it upside down would look even better:
|
|
|
||
| /// Get auto id and advance auto id counter by 1. | ||
| #[inline] | ||
| pub fn get_auto_id(&mut self) -> Id { |
There was a problem hiding this comment.
get sounds like it doesn't change anything, which it does
| pub fn get_auto_id(&mut self) -> Id { | |
| pub fn allocate_auto_id(&mut self) -> Id { |
But it is indeed a tree. When you create an Id like this: I guess we could show the source with the debug format instead, since source usually is pretty flat. But if you e.g. pass a widget id as a source via |
With this, we can see the full tree of how auto ids are derived: