Emil Ernerfeldt/egui: Release 0.29.0
Name: egui
Owner: Emil Ernerfeldt
Release: 0.29.0 - Multipass, `UiBuilder`, & visual improvements
Released: 2024-09-26
License: Apache-2.0
Release Assets:
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
What text selection used to look like
🧳 Migration
id_sourceis now calledid_salteverywhere (#5025)Ui::newnow takes aUiBuilder(#4969)- Deprecated (replaced with
UiBuilder):ui.add_visible_uiui.allocate_ui_at_rectui.child_uiui.child_ui_with_id_sourceui.push_stack_info
⭐ Added
- Create a
UiBuilderfor buildingUis #4969 by @emilk - Add
egui::Sidesfor adding UI on left and right sides #5036 by @emilk - Make light & dark visuals customizable when following the system theme #4744 #4860 by @bash
- Interactive
Ui:s: addUiBuilder::senseandUi::response#5054 by @lucasmerlin - Add a menu button with text and image #4748 by @NicolasBircksZR
- Add
Ui::columns_const()#4764 by @v0x0g - Add
Slider::max_decimals_opt#4953 by @bircni - Add
Label::halign#4975 by @rustbasic - Add
ui.shrink_clip_rect#5068 by @emilk - Add
ScrollArea::scroll_bar_rect#5070 by @emilk - Add
Options::input_optionsfor click-delay etc #4942 by @girtsf - Add
WidgetType::RadioGroup#5081 by @bash - Add return value to
with_accessibility_parent#5083 by @bash - Add
Ui::with_visual_transform#5055 by @lucasmerlin - Make
SliderandDragValuecompatible withNonZeroUsizeetc #5105 by @emilk - Add
Context::request_discardfor multi-pass layouts #5059 by @emilk - Add UI to modify
FontTweaklive #5125 by @emilk - Add
Response::intrinsic_sizeto enable better layout in 3rd party crates #5082 by @lucasmerlin - Add support for mipmap textures #5146 by @nolanderc
- Add
DebugOptions::show_unaligned#5165 by @emilk - Add
Slider::clampingfor precise clamp control #5119 by @emilk
🚀 Performance
- Optimize
Color32::from_rgba_unmultipliedwith LUT #5088 by @YgorSouza
🔧 Changed
- Rename
id_sourcetoid_salt#5025 by @bircni - Avoid some
Idclashes by seeding auto-ids with child id #4840 by @ironpeak - Nicer looking text selection, especially in light mode #5017 by @emilk
- Fix blurry lines by aligning to pixel grid #4943 by @juancampa
- Center-align all text vertically #5117 by @emilk
- Clamp margin values in
Margin::ui#4873 by @rustbasic - Make
scroll_to_*animations configurable #4305 by @lucasmerlin - Update
Buttonto correctly align contained image #4891 by @PrimmR - Deprecate
ahashre-exports #4979 by @oscargus - Fix: Ensures correct IME behavior when the text input area gains or loses focus #4896 by @rustbasic
- Enable rustdoc
generate-link-to-definitionfeature on docs.rs #5030 by @GuillaumeGomez - Make some
Memorymethods public #5046 by @bircni - Deprecate
ui.set_sizing_pass#5074 by @emilk - Export module
egui::frame#5087 by @simgt - Use
logcrate instead ofeprintln& remove some unwraps #5010 by @bircni - Fix:
Event::CopyandEvent::Cutbehave as if they select the entire text when there is no selection #5115 by @rustbasic
🐛 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
TextEditto 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
TextEditwhen clicked #4991 by @Zoxc - Fix
Idclash inFramestyling widget #4967 by @YgorSouza - Prevent
ScrollAreacontents from exceeding the container size #5006 by @DouglasDwyer - Fix bug in size calculation of truncated text #5076 by @emilk
- Fix: Make sure
RawInput::takeclears all events, like it says it does #5104 by @emilk - Fix
DragValuerange clamping #5118 by @emilk - Fix: panic when dragging window between monitors of different pixels_per_point #4868 by @rustbasic
eframe changelog
✨ Highlights
🧳 Migration
WebRunner::startnow expects aHtmlCanvasElementrather than the id of it (#4780)NativeOptions::follow_system_themeanddefault_themeis gone, and is now inegui::Optionsinstead (#4860)
⭐ Added
- Conditionally propagate web events using a filter in WebOptions #5056 by @liamrosenfeld
🔧 Changed
- Pass
HtmlCanvasElementelement directly inWebRunner::start#4780 by @jprochazk - Upgrade winit to 0.30.2 #4849 #4939 by @ArthurBrussee
- Allow non-
staticeframe::Applifetime #5060 by @timstr - Improve
glowcontext switching #4814 by @rustbasic - Ignore viewport size/position on iOS #4922 by @frederik-uni
- Update
web-sys&wasm-bindgen#4980 by @bircni - Remove the need for setting
web_sys_unstable_apis#5000 by @emilk - Remove the
directoriesdependency #4904 by @YgorSouza - It's now possible to opt-out of the wgpu-feature
fragile-send-sync-non-atomic-wasmby @9SMTM6 in #5098 - Update to wgpu 22.1 #4964 by @wumpf & #4847 by @KeKsBoTer
- Wgpu paint callback now gets a
wgpu::RenderPass<'static>, making it easier to insert resources not owned byCallbackResources#5149 by @wumpf
🐛 Fixed
- Fix: call
savewhen hiding web tab, andupdatewhen focusing it #5114 by @emilk - Force canvas/text input focus on touch for iOS web browsers #4848 by @BKSalman
- Fix virtual keyboard on (mobile) web #4855 by @micmonay
- Fix: Backspace not working after IME input #4912 by @rustbasic
- Fix iOS build, and add iOS step to CI #4898 by @lucasmerlin
- Fix iOS compilation of eframe #4851 by @ardocrat
- Fix crash when changing viewport settings #4862 by @pm100
- Fix eframe centering on multiple monitor systems #4919 by @VinTarZ
- Fix viewport not working when minimized #5042 by @rustbasic
- Clarified
eframe::run_simple_native()persistence #4846 by @tpstevens