Skip to content

0.29.0 - Multipass, `UiBuilder`, & visual improvements

Compare
Choose a tag to compare
@emilk emilk released this 26 Sep 13:35
· 125 commits to master since this release

egui is an easy-to-use immediate mode GUI for Rust that runs on both web and native.

Try it now: https://www.egui.rs/

egui development is sponsored by Rerun, a startup building an SDK for visualizing streams of multimodal data.

egui changelog

✨ Highlights

This release adds initial support for multi-pass layout, which is a tool to circumvent a common limitation of immediate mode.
You can use the new UiBuilder::sizing_pass (#4969) to instruct the Ui and widgets to shrink to their minimum size, then store that size.
Then call the new Context::request_discard (#5059) to discard the visual output and do another pass immediately after the current finishes.
Together, this allows more advanced layouts that is normally not possible in immediate mode.
So far this is only used by egui::Grid to hide the "first-frame jitters" that would sometimes happen before, but 3rd party libraries can also use it to do much more advanced things.

There is also a new UiBuilder for more flexible construction of Uis (#4969).
By specifying a sense for the Ui you can make it respond to clicks and drags, reading the result with the new Ui::response (#5054).
Among other things, you can use this to create buttons that contain arbitrary widgets.

0.29 also adds improve support for automatic switching between light and dark mode.
You can now set up a custom Style for both dark and light mode, and have egui follow the system preference (#4744 #4860).

There also has been several small improvements to the look of egui:

  • Fix vertical centering of text (e.g. in buttons) (#5117)
  • Sharper rendering of lines and outlines (#4943)
  • Nicer looking text selection, especially in light mode (#5017)

The new text selection

New text selection in light mode New text selection in dark mode

What text selection used to look like

Old text selection in light mode Old text selection in dark mode

🧳 Migration

  • id_source is now called id_salt everywhere (#5025)
  • Ui::new now takes a UiBuilder (#4969)
  • Deprecated (replaced with UiBuilder):
    • ui.add_visible_ui
    • ui.allocate_ui_at_rect
    • ui.child_ui
    • ui.child_ui_with_id_source
    • ui.push_stack_info

⭐ Added

🚀 Performance

🔧 Changed

🐛 Fixed

  • Prevent text shrinking in tooltips; round wrap-width to integer #5161 by @emilk
  • Fix bug causing tooltips with dynamic content to shrink #5168 by @emilk
  • Remove some debug asserts #4826 by @emilk
  • Handle the IME event first in TextEdit to fix some bugs #4794 by @rustbasic
  • Slider: round to decimals after applying step_by #4822 by @AurevoirXavier
  • Fix: hint text follows the alignment set on the TextEdit #4889 by @PrimmR
  • Request focus on a TextEdit when clicked #4991 by @Zoxc
  • Fix Id clash in Frame styling widget #4967 by @YgorSouza
  • Prevent ScrollArea contents from exceeding the container size #5006 by @DouglasDwyer
  • Fix bug in size calculation of truncated text #5076 by @emilk
  • Fix: Make sure RawInput::take clears all events, like it says it does #5104 by @emilk
  • Fix DragValue range clamping #5118 by @emilk
  • Fix: panic when dragging window between monitors of different pixels_per_point #4868 by @rustbasic

eframe changelog

✨ Highlights

🧳 Migration

  • WebRunner::start now expects a HtmlCanvasElement rather than the id of it (#4780)
  • NativeOptions::follow_system_theme and default_theme is gone, and is now in egui::Options instead (#4860)

⭐ Added

🔧 Changed

🐛 Fixed