egui icon indicating copy to clipboard operation
egui copied to clipboard

egui: Add `Deref<Target = Context>` for `Ui`

Open obellish opened this issue 1 year ago • 12 comments

obellish avatar Feb 19 '24 12:02 obellish

Does this mean we can remove .input() .memory etc from Ui?

emilk avatar Mar 08 '24 09:03 emilk

I believe so, as any methods on ctx will be on Ui as well, so duplicate methods can go away

obellish avatar Mar 08 '24 14:03 obellish

I didn't include DerefMut but I could as it would allow for us to pass a &mut Ui where a &mut Context is expected.

obellish avatar Mar 08 '24 16:03 obellish

We shouldn't implement DerefMut, because a &mut Context in almost never needed. But we should remove the now redundant Ui::input etc

emilk avatar Mar 12 '24 10:03 emilk

Removed all the direct helper methods from Ui.

obellish avatar Mar 12 '24 13:03 obellish

There are some cargo check failures

emilk avatar Mar 21 '24 09:03 emilk

Removed the unused deps!

obellish avatar Mar 21 '24 17:03 obellish

a docstring needs updating too

emilk avatar Mar 21 '24 17:03 emilk

Which one?

obellish avatar Mar 22 '24 11:03 obellish

Check the CI output:

Screenshot 2024-03-22 at 12 27 45

emilk avatar Mar 22 '24 11:03 emilk

I tried fixing this myself, but since you opened the PR from your own master it failed.

emilk avatar Mar 25 '24 10:03 emilk

Is there any plan to merge this? It would be nice

TimTheBig avatar Oct 19 '25 17:10 TimTheBig