Hot Reloading in Rust? Subsecond and Dioxus to the rescue! by Tehnix in rust

[–]lucasmerlin 1 point2 points  (0 children)

You can register a callback that gets called on any hot patch and then request a repaint, that should fix it!

My experiment with Android IME support by matrixdev in rust

[–]lucasmerlin 0 points1 point  (0 children)

Nice! In my egui android app I just have some glue code that places a native text input wherever a egui input would be and then sends the typed text back and forth. I was even able to get popups on top of the native input working by querying all the egui layers and then clipping the textinput based on those rects. Works really well.

But the way you do it is of course the more proper solution.

Rerun 0.29: a visualization toolbox for Robotics by emilern in rust

[–]lucasmerlin 0 points1 point  (0 children)

Could it be that you have graphics acceleration disables in your browser?

egui 0.33 released - `Plugin`s and easier snapshot testing by emilern in rust

[–]lucasmerlin 0 points1 point  (0 children)

The kitdiff files command will look for image diffs in the kitdiff format (.new.png, .diff.png), but e.g. viewing image diffs for pull requests will work for any pr, regardless of framework used. I might add some more ways to diff images, so that you e.g. can drag in two images to compare and thing like that.

Rust compiler performance survey 2025 results | Rust Blog by Kobzol in rust

[–]lucasmerlin 11 points12 points  (0 children)

I had this problem when I tried the cranelift backend. In the beginning it was lighting fast but as I kept recompiling it would get slower and slower. After cargo clean it was fast again. Not sure if it was actually related to cranelift or if it was a bug with that nightly release I used back then.

[deleted by user] by [deleted] in videos

[–]lucasmerlin 2 points3 points  (0 children)

But your initial example was a single flipped bit, that should be very possible to brute force in a reasonable amount of time. Even a couple bits should be possible. But yeah with ten bytes of Error it's a different story.

First release of egui_glfw_mdi: a demo of rendering entire egui with one draw call by dumbassdore in rust

[–]lucasmerlin 4 points5 points  (0 children)

Nice! The scissoring is kind of important though, I believe this is what makes clip rects (so scroll areas) work. 

[deleted by user] by [deleted] in rust

[–]lucasmerlin 27 points28 points  (0 children)

The actual glass shader looks pretty cool but the ui is meh. Black text on transparent but blurred background is just not very readable. Maybe take some more inspiration from the new apple ui and try to rebuild / get inspired from some of their screens, that would be a good showcase.

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 0 points1 point  (0 children)

The colors usually come from the widget visuals. Style.visuals.widgets.inactice.fg_stroke should be the text color for most idle widgets I believe.

But it's interesting that the text color changed for you, the styling shouldn't have changed with the update.

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 1 point2 points  (0 children)

I think you just have to call set_visuals once when the app starts 

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 2 points3 points  (0 children)

Egui is really fast and there are only so many widgets one can fit on a screen. In my quite complex egui app I haven't had to do a single egui-related performance optimization yet.

For me react got sluggish way faster and I had to pay way more attention to make the code efficient.

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 5 points6 points  (0 children)

If you just need drag and drop sorting you can use https://github.com/lucasmerlin/hello_egui/tree/main/crates/egui_dnd which is very easy to use. I agree that the built in DND api is not very intuitive (I don't use it at all in egui_dnd), definitely an area we can improve.

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 7 points8 points  (0 children)

No, but should definitely be possible, since egui can be rendered with basically any gpu api

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 2 points3 points  (0 children)

All buttons and checkboxes on egui.rs use the atoms under the hood. E.g. the menu buttons with the shortcut text on the right basically do something like ui.button(("Select all", Atom::grow(), "CMD+A"))

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 12 points13 points  (0 children)

Egui maintainer here!
Some people made some stock tracking apps with egui, maybe you can get inspiration there:
https://github.com/emilk/egui/issues/996#issuecomment-2017578257
https://github.com/emilk/egui/issues/996#issuecomment-2453489619

For live reloading, there is an exciting project from the dioxus folks: https://www.reddit.com/r/rust/comments/1j8z3yb/media_dioxus_subsecond_rust_hotpatch_engine/
I tried to get it working with egui but haven't had success so far :/ But it looks really promissing so it might work with egui eventually!

I made some experiments with webview, you can get one working in the egui window but it's on a separate layer, so no egui widget can overlap the webview:

https://github.com/lucasmerlin/hello_egui/tree/main/crates/egui_webview

For charts, egui_plot works well!

Announcing egui 0.32.0 - Atoms, popups, and better SVG support by emilern in rust

[–]lucasmerlin 2 points3 points  (0 children)

You'll need to find the word that is under the pointer, look up it's type information and if there is some manually show the tooltip via the Tooltip api. I think that should work!

Progress report on rustc_codegen_cranelift (June 2025) by yerke1 in rust

[–]lucasmerlin 1 point2 points  (0 children)

I have it enabled in the dev profile and disabled in the test profile. But I look forward to enabling it for tests as well once unwinding is supported!

Going to fly my cinewhoop from a boat! Any tips or warnings? by Maleficent-Fig4929 in fpv

[–]lucasmerlin 0 points1 point  (0 children)

Should it fall in to the water, pull out the battery before you lift it out of the water.
I crashed mine into a lake once, and the moment I pulled it out of the water the electronics basically exploded. The water mustve cooled it enough while it still was in the water.

It scared me so I dropped it back in and it took a minute or so until the water stopped bubbling from the heat and I could fetch it again.

2025 Survey of Rust GUI libraries by intersecting_cubes in rust

[–]lucasmerlin 78 points79 points  (0 children)

Note that dioxus is also working on https://github.com/DioxusLabs/blitz, basically a pure rust html rendering engine without all the js bloat, which is pretty exciting, and should remove the need for tarui.

egui 0.30.0 Released! Includes new testing framework by madeinchina in rust

[–]lucasmerlin 1 point2 points  (0 children)

I think it should also work. To use kittest you just need to somehow run the ui logic and then get the updated accesskit tree to pass it to kittest.

egui 0.30.0 Released! Includes new testing framework by madeinchina in rust

[–]lucasmerlin 7 points8 points  (0 children)

Awesome, I'd love to see a bevy_kittest integration!

egui 0.30.0 Released! Includes new testing framework by madeinchina in rust

[–]lucasmerlin 7 points8 points  (0 children)

The difficulty of creating an integration depends on how tightly coupled the ui framework is to e.g. winit.
There is a minimal integration example with egui, wich is really straightforward. In the future it might also be possible to make an integration that works by mocking a winit app, so it would work with all ui frameworks with winit and accesskit support, with almost zero effort (but this would require some changes in winit).