0.33.0 - `egui::Plugin`, better kerning, kitdiff viewer
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.
Highlights from this release:
egui::Plugina improved way to create and access egui plugins- kitdiff, a viewer for egui_kittest image snapshots (and a general image diff tool)
- better kerning
As a step towards using parley for font rendering, @valadaptive has refactored the font loading and rendering code. A result of this (next to the font rendering code being much nicer now) is improved kerning. Notice how the c moved away from the k:
- More even text kerning #7431 by @valadaptive
We've added a new trait-based plugin api, meant to replace Context::on_begin_pass and Context::on_end_pass. This makes it a lot easier to handle state in your plugins. Instead of having to write to egui memory it can live right on your plugin struct. The trait based api also makes easier to add new hooks that plugins can use. In addition to on_begin_pass and on_end_pass, the Plugin trait now has a input_hook and output_hook which you can use to inspect / modify the RawInput / FullOutput.
- New Plugin trait #7385 by @lucasmerlin
At rerun we have a ton of snapshots. Some PRs will change most of them (e.g. the one that updated egui and introduced the kerning improvements, ~500 snapshots changed!). If you really want to look at every changed snapshot it better be as efficient as possible, and the experience on github, fiddeling with the sliders, is kind of frustrating. In order to fix this, we've made kitdiff. You can use it locally via
kitdiff files .will search for .new.png and .diff.png fileskitdiff gitwill compare the current files to the default branch (main/master) Or in the browser via- going to https://rerun-io.github.io/kitdiff/ and pasting a PR or github artifact url
- linking to kitdiff via e.g. a github workflow
https://rerun-io.github.io/kitdiff/?url=<link_to_pr_or_artifact>
To install kitdiff run cargo install --git https://github.com/rerun-io/kitdiff. You might need to login with your github account for viewing artifacts and to prevent running into rate limits.
Here is a video showing the kerning changes in kitdiff (try it yourself):
https://github.com/user-attachments/assets/74640af1-09ba-435a-9d0c-2cbeee140c8f
egui::Mutexnow has a timeout as a simple deadlock detection- If you use a
egui::Mutexin some place where it's held for longer than a single frame, you should switch to the std mutex or parking_lot instead (egui mutexes are wrappers around parking lot)
- If you use a
screen_rectis deprecated- In order to support safe areas, egui now has
viewport_rectandcontent_rect. - Update all usages of
screen_recttocontent_rect, unless you are sure that you want to draw outside thesafe area(which would mean your Ui may be covered by notches, system ui, etc.)
- In order to support safe areas, egui now has
- New Plugin trait #7385 by @lucasmerlin
- Add
Ui::take_available_space()helper function, which sets the Ui's minimum size to the available space #7573 by @IsseW - Add support for the safe area on iOS #7578 by @irh
- Add
UiBuilder::global_scopeandUiBuilder::id#7372 by @Icekey - Add
emath::fast_midpoint#7435 by @emilk - Make the
hex_colormacroconst#7444 by @YgorSouza - Add
SurrenderFocusOnoption #7471 by @lucasmerlin - Add
Memory::move_focus#7476 by @darkwater - Support on hover tooltip that is noninteractable even with interactable content #5543 by @PPakalns
- Add rotation gesture support for trackpad sources #7453 by @thatcomputerguy0101
- Document platform compatibility on
viewport::WindowLeveland dependents #7432 by @lkdm - Deprecated
ImageButtonand removedWidgetType::ImageButton#7483 by @Stelios-Kourlis - More even text kerning #7431 by @valadaptive
- Increase default text size from 12.5 to 13.0 #7521 by @emilk
- Update accesskit to 0.21.0 #7550 by @fundon
- Update MSRV from 1.86 to 1.88 #7579 by @Wumpf
- Group AccessKit nodes by
Ui#7386 by @lucasmerlin
- Remove the
deadlock_detectionfeature #7497 by @lucasmerlin - Remove deprecated fields from
PlatformOutput#7523 by @emilk - Remove
logfeature #7583 by @emilk
- Enable
clippy::iter_over_hash_typelint #7421 by @emilk - Fixes sense issues in TextEdit when vertical alignment is used #7436 by @RndUsr123
- Fix stuck menu when submenu vanishes #7589 by @lucasmerlin
- Change Spinner widget to account for width as well as height #7560 by @bryceberger
0.32.3 - Fix tooltips for ellided text
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.
- Preserve text format in truncated label tooltip #7514 #7535 by @lucasmerlin
- Fix
TextEdit's in RTL layouts #5547 by @zakarumych - Optimize
Mesh::add_rect_with_uv#7511 by @valadaptive
0.32.2 - Ui::place, Harness::mask and more bug fixes
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.
Ui::place is similar to Ui::put, but it doesn't update the current Uis cursor. This is very useful when using the new Atoms or making badge-like widgets. The following breaks with Ui::put but works just fine with Ui::place:
Harness::mask allows for simple masking of Rects you don't want to be visible in snapshot test images. The rect will be masked with a ugly color to make it obvious whats going on:
- Add
Ui::place, to place widgets without changing the cursor #7359 by @lucasmerlin - Fix:
SubMenushould not display when ui is disabled #7428 by @ozwaldorf - Remove line breaks when pasting into single line TextEdit #7441 by @YgorSouza
- Panic mutexes that can't lock for 30 seconds, in debug builds #7468 by @emilk
- Fix: prevent calendar popup from closing on dropdown change #7409 by @AStrizh
- Fix memory leak when
forget_imageis called while loading #7380 by @Vanadiae - Fix deadlock in
ImageLoader,FileLoader,EhttpLoader#7494 by @lucasmerlin
- Allow masking widgets in kittest snapshots #7467 by @lucasmerlin
- Panic mutexes that can't lock for 30 seconds, in debug builds #7468 by @emilk
- Skip zero-length layout job sections #7430 by @HactarCE
- Add track_caller to Mutex and RwLock for deadlock_detection b17d716
0.32.1 - Misc bug fixes
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.
- Add
ComboBox::popup_style#7360 by @lucasmerlin
- Fix glyph rendering: clamp coverage to [0, 1] #7415 by @emilk
- Fix manual
Popupnot closing #7383 by @lucasmerlin - Fix
WidgetText::Textignoring fallback font and overrides #7361 by @lucasmerlin - Fix
override_text_colorpriority #7439 by @YgorSouza - Fix debug-panic in ScrollArea if contents fit without scrolling #7440 by @YgorSouza
- Enable wgpu default features in eframe / egui_wgpu default features #7344 by @lucasmerlin
- Request a redraw when the url change through the
popstateevent listener #7403 by @irevoire
0.32.0 - Atoms, popups, and better SVG support
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.
This is a big egui release, with several exciting new features!
- Atoms are new layout primitives in egui, for text and images
- Popups, tooltips and menus have undergone a complete rewrite
- Much improved SVG support
- Crisper graphics (especially text!)
Let's dive in!
egui::Atom is the new, indivisible building block of egui (hence the name). It lets you mix images and text in many places where you would previously only be able to add text.
Atoms is the first step towards a more powerful layout engine in egui - more to come!
Right now an Atom is an enum that can be either WidgetText, Image, or Custom.
The new AtomLayout can be used within widgets to do basic layout. The initial implementation is as minimal as possible, doing just enough to implement what Button could do before. There is a new IntoAtoms trait that works with tuples of Atoms. Each atom can be customized with the AtomExt trait which works on everything that implements Into<Atom>, so e.g. RichText or Image. So to create a Button with text and image you can now do:
let image = include_image!("my_icon.png").atom_size(Vec2::splat(12.0));
ui.button((image, "Click me!"));
Anywhere you see impl IntoAtoms you can add any number of images and text, in any order.
As of 0.32, we have ported the Button, Checkbox, RadioButton to use atoms (meaning they support adding Atoms and are built on top of AtomLayout). The Button implementation is not only more powerful now, but also much simpler, removing ~130 lines of layout math.
In combination with ui.read_response, custom widgets are really simple now, here is a minimal button implementation:
pub struct ALButton<'a> {
al: AtomLayout<'a>,
}
impl<'a> ALButton<'a> {
pub fn new(content: impl IntoAtoms<'a>) -> Self {
Self {
al: AtomLayout::new(content.into_atoms()).sense(Sense::click()),
}
}
}
impl<'a> Widget for ALButton<'a> {
fn ui(mut self, ui: &mut Ui) -> Response {
let Self { al } = self;
let response = ui.ctx().read_response(ui.next_auto_id());
let visuals = response.map_or(&ui.style().visuals.widgets.inactive, |response| {
ui.style().interact(&response)
});
let al = al.frame(
Frame::new()
.inner_margin(ui.style().spacing.button_padding)
.fill(visuals.bg_fill)
.stroke(visuals.bg_stroke)
.corner_radius(visuals.corner_radius),
);
al.show(ui).response
}
}
You can even use Atom::custom to add custom content to Widgets. Here is a button in a button:
https://github.com/user-attachments/assets/8c649784-dcc5-4979-85f8-e735b9cdd090
let custom_button_id = Id::new("custom_button");
let response = Button::new((
Atom::custom(custom_button_id, Vec2::splat(18.0)),
"Look at my mini button!",
))
.atom_ui(ui);
if let Some(rect) = response.rect(custom_button_id) {
ui.put(rect, Button::new("🔎").frame_when_inactive(false));
}
Currently, you need to use atom_ui to get a AtomResponse which will have the Rect to use, but in the future this could be streamlined, e.g. by adding a AtomKind::Callback or by passing the Rects back with egui::Response.
Basing our widgets on AtomLayout also allowed us to improve Response::intrinsic_size, which will now report the correct size even if widgets are truncated. intrinsic_size is the size that a non-wrapped, non-truncated, non-justified version of the widget would have, and can be useful in advanced layout calculations like egui_flex.
- Add
AtomLayout, abstracting layouting within widgets #5830 by @lucasmerlin - Add
Galley::intrinsic_sizeand use it inAtomLayout#7146 by @lucasmerlin
Introduces a new egui::Popup api. Checkout the new demo on https://egui.rs:
https://github.com/user-attachments/assets/74e45243-7d05-4fc3-b446-2387e1412c05
We introduced a new RectAlign helper to align a rect relative to an other rect. The Popup will by default try to find the best RectAlign based on the source widgets position (previously submenus would annoyingly overlap if at the edge of the window):
https://github.com/user-attachments/assets/0c5adb6b-8310-4e0a-b936-646bb4ec02f7
Tooltip and menu have been rewritten based on the new Popup api. They are now compatible with each other, meaning you can just show a ui.menu_button() in any Popup to get a sub menu. There are now customizable MenuButton and SubMenuButton structs, to help with customizing your menu buttons. This means menus now also support PopupCloseBehavior so you can remove your close_menu calls from your click handlers!
The old tooltip and popup apis have been ported to the new api so there should be very little breaking changes. The old menu is still around but deprecated. ui.menu_button etc now open the new menu, if you can't update to the new one immediately you can use the old buttons from the deprecated egui::menu menu.
We also introduced ui.close() which closes the nearest container. So you can now conveniently close Windows, Collapsibles, Modals and Popups from within. To use this for your own containers, call UiBuilder::closable and then check for closing within that ui via ui.should_close().
- Add
PopupandTooltip, unifying the previous behaviours #5713 by @lucasmerlin - Add
Ui::closeandResponse::should_close#5729 by @lucasmerlin ⚠️ Improved menu based onegui::Popup#5716 by @lucasmerlin- Add a toggle for the compact menu style #5777 by @s-nie
- Use the new
PopupAPI for the color picker button #7137 by @lucasmerlin ⚠️ Close popup ifMemory::keep_popup_openisn't called #5814 by @juancampa- Fix tooltips sometimes changing position each frame #7304 by @emilk
- Change popup memory to be per-viewport #6753 by @mkalte666
- Deprecate
Memory::popupAPI in favor of newPopupAPI #7317 by @emilk
You can render SVG in egui with
ui.add(egui::Image::new(egui::include_image!("icon.svg"));
(Requires the use of egui_extras, with the svg feature enabled and a call to install_image_loaders).
Previously this would sometimes result in a blurry SVG, epecially if the Image was set to be dynamically scale based on the size of the Ui that contained it. Now SVG:s are always pixel-perfect, for truly scalable graphics.
- Support text in SVGs #5979 by @cernec1999
- Fix sometimes blurry SVGs #7071 by @emilk
- Fix incorrect color fringe colors on SVG:s #7069 by @emilk
- Make
Image::paint_atpixel-perfect crisp for SVG images #7078 by @emilk
Non-SVG icons are also rendered better, and text sharpness has been improved, especially in light mode.
- Improve text sharpness #5838 by @emilk
- Improve text rendering in light mode #7290 by @emilk
- Improve texture filtering by doing it in gamma space #7311 by @emilk
- Make text underline and strikethrough pixel perfect crisp #5857 by @emilk
We have some silently breaking changes (code compiles fine but behavior changed) that require special care:
- wgpu 25 made the gles and vulkan backends optional
- We missed this, so for now you need to manually opt in to those backends. Add the following to you Cargo.toml
wgpu = "25" # enables the wgpu default features so we get the default backends
- We missed this, so for now you need to manually opt in to those backends. Add the following to you Cargo.toml
- Previously menus would only close on click outside
- Either
- Remove the
ui.close_menu()calls from button click handlers since they are obsolete - If the menu should stay open on clicks, change the
PopupCloseBehavior:You can also change the behavior only for a single SubMenu by using// Change this ui.menu_button("Text", |ui| { /* Menu Content */ }); // To this: MenuButton::new("Text").config( MenuConfig::default().close_behavior(PopupCloseBehavior::CloseOnClickOutside), ).ui(ui, |ui| { /* Menu Content */ });
SubMenuButton, but by default it should be passed to any submenus when usingMenuButton.
- Remove the
- The popup will immediately close if
keep_popup_openis not called. - It's recommended to use the new
Popupapi which handles this for you. - If you can't switch to the new api for some reason, update the code to call
keep_popup_open:if ui.memory(|mem| mem.is_popup_open(popup_id)) { ui.memory_mut(|mem| mem.keep_popup_open(popup_id)); // <- add this line let area_response = Area::new(popup_id).show(...) }
- Add
Label::show_tooltip_when_elided#5710 by @bryceberger - Deprecate
Ui::allocate_new_uiin favor ofUi::scope_builder#5764 by @lucasmerlin - Add
expand_bgto customize size of text background #5365 by @MeGaGiGaGon - Add assert messages and print bad argument values in asserts #5216 by @bircni
- Use
TextBufferforlayouterinTextEditinstead of&str#5712 by @kernelkind - Add a
Slider::update_while_editing(bool)API #5978 by @mbernat - Add
Scene::drag_pan_buttonsoption. Allows specifying which pointer buttons pan the scene by dragging #5892 by @mitchmindtree - Add
Scene::senseto customize howSceneresponds to user input #5893 by @mitchmindtree - Rework
TextEditarrow navigation to handle Unicode graphemes #5812 by @MStarha ScrollAreaimprovements for user configurability #5443 by @MStarha- Add
Response::clicked_with_open_in_background#7093 by @emilk - Add
Modifiers::matches_any#7123 by @emilk - Add
Context::format_modifiers#7125 by @emilk - Add
OperatingSystem::is_mac#7122 by @emilk - Support vertical-only scrolling by holding down Alt #7124 by @emilk
- Support for back-button on Android #7073 by @ardocrat
- Select all text in DragValue when gaining focus via keyboard #7107 by @Azkellas
- Add
Context::current_pass_index#7276 by @emilk - Add
Context::cumulative_frame_nr#7278 by @emilk - Add
Visuals::text_edit_bg_color#7283 by @emilk - Add
Visuals::weak_text_alphaandweak_text_color#7285 by @emilk - Add support for scrolling via accesskit / kittest #7286 by @lucasmerlin
- Update area struct to allow force resizing #7114 by @blackberryfloat
- Add
egui::Sidesshrink_left/shrink_right#7295 by @lucasmerlin - Set intrinsic size for Label #7328 by @lucasmerlin
- Raise MSRV to 1.85 #6848 by @torokati44, #7279 by @emilk
- Set
hint_textinWidgetInfo#5724 by @bircni - Implement
DefaultforThemePreference#5702 by @MichaelGrupp - Align
available_rectdocs with the new reality after #4590 #5701 by @podusowski - Clarify platform-specific details for
Viewportpositioning #5715 by @aspiringLich - Simplify the text cursor API #5785 by @valadaptive
- Bump accesskit to 0.19 #7040 by @valadaptive
- Better define the meaning of
SizeHint#7079 by @emilk - Move all input-related options into
InputOptions#7121 by @emilk Buttoninherits thealt_textof theImagein it, if any #7136 by @emilk- Change API of
Tooltipslightly #7151 by @emilk - Use Rust edition 2024 #7280 by @emilk
- Change
ui.disable()to modify opacity #7282 by @emilk - Make the font atlas use a color image #7298 by @valadaptive
- Implement
BitOrandBitOrAssignforRect#7319 by @lucasmerlin
- Remove things that have been deprecated for over a year #7099 by @emilk
- Remove
SelectableLabel#7277 by @lucasmerlin
Scene: makescene_rectfull size on reset #5801 by @graydenshandScene:TextEditselection when placed in aScene#5791 by @karhuScene: Set transform layer before calling user content #5884 by @mitchmindtree- Fix: transform
TextShapeunderline width #5865 by @emilk - Fix missing repaint after
consume_key#7134 by @lucasmerlin - Update
emoji-icon-fontwith fix for fullwidth latin characters #7067 by @emilk - Mark all keys as released if the app loses focus #5743 by @emilk
- Fix scroll handle extending outside of
ScrollArea#5286 by @gilbertoalexsantos - Fix
Response::clicked_elsewherenot returningtruesometimes #5798 by @lucasmerlin - Fix kinetic scrolling on touch devices #5778 by @lucasmerlin
- Fix
DragValueexpansion when editing #5809 by @MStarha - Fix disabled
DragValueeating focus, causing focus to reset #5826 by @KonaeAkira - Fix semi-transparent colors appearing too bright #5824 by @emilk
- Improve drag-to-select text (add margins) #5797 by @hankjordan
- Fix bug in pointer movement detection #5329 by @rustbasic
- Protect against NaN in hit-test code #6851 by @Skgland
- Fix image button panicking with tiny
available_space#6900 by @lucasmerlin - Fix links and text selection in horizontal_wrapped layout #6905 by @lucasmerlin
- Fix
leading_spacesometimes being ignored during paragraph splitting #7031 by @afishhh - Fix typo in deprecation message for
ComboBox::from_id_source#7055 by @aelmizeb - Bug fix: make sure
end_passis called for all loaders #7072 by @emilk - Report image alt text as text if widget contains no other text #7142 by @lucasmerlin
- Slider: move by at least the next increment when using fixed_decimals #7066 by @0x53A
- Fix crash when using infinite widgets #7296 by @emilk
- Fix
debug_asserttriggered bymenu/intersect_ray#7299 by @emilk - Change
Rect::areato return zero for negative rectangles #7305 by @emilk
- Optimize editing long text by caching each paragraph #5411 by @afishhh
- Make
WidgetTextsmaller and faster #6903 by @lucasmerlin
- Add pointer events and focus handling for apps run in a Shadow DOM #5627 by @xxvvii
- MacOS: Add
movable_by_window_backgroundoption to viewport #5412 by @jim-ec - Add macOS-specific
has_shadowandwith_has_shadowto ViewportBuilder #6850 by @gaelanmcmillan - Add external eventloop support #6750 by @wpbrown
- Update MSRV to 1.85 #7279 by @emilk
- Use Rust edition 2024 #7280 by @emilk
- Rename
should_propagate_eventand addshould_prevent_default#5779 by @th0rex - Clarify platform-specific details for
Viewportpositioning #5715 by @aspiringLich - Enhance stability on Windows #5723 by @rustbasic
- Set
web-sysmin version to0.3.73#5862 by @wareya - Bump
ronto0.10.1#6861 by @torokati44 - Disallow
accesskiton Android NativeActivity, makinghello_androidworking again #6855 by @podusowski - Respect and detect
prefers-color-scheme: no-preference#7293 by @emilk
- Mark all keys as up if the app loses focus #5743 by @emilk
- Fix text input on Android #5759 by @StratusFearMe21
- Fix text distortion on mobile devices/browsers with
glowbackend #6893 by @wareya - Workaround libpng crash on macOS by not creating
NSImagefrom png data #7252 by @Wumpf - Fix incorrect window sizes for non-resizable windows on Wayland #7103 by @GoldsteinE
- Web: only consume copy/cut events if the canvas has focus #7270 by @emilk
0.31.1 - TextEdit and egui_kittest fixes
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.
- Fix sizing bug in
TextEdit::singleline#5640 by @IaVashik - Fix panic when rendering thin textured rectangles #5692 by @PPakalns
- Fix image_loader for animated image types #5688 by @BSteffaniak
- Fix modifiers not working in kittest #5693 by @lucasmerlin
- Enable all features for egui_kittest docs #5711 by @YgorSouza
- Run a frame per queued event in egui_kittest #5704 by @lucasmerlin
- Add guidelines for image comparison tests #5714 by @Wumpf
0.31.0 - Scene container, improved rendering quality
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.
This release adds the Scene container to egui. It is a pannable, zoomable canvas that can contain Widgets and child Uis. This will make it easier to e.g. implement a graph editor.
The tessellator has been updated for improved rendering quality and better performance. It will produce fewer vertices and shapes will have less overdraw. We've also defined what CornerRadius (previously Rounding) means.
We've also added a tessellator test to the demo app, where you can play around with different values to see what's produced:
https://github.com/user-attachments/assets/adf55e3b-fb48-4df0-aaa2-150ee3163684
Check the PR for more details.
In order to pave the path for more complex and customizable styling solutions, we've reduced the size of CornerRadius, Margin and Shadow values to i8 and u8.
- Add a
StrokeKindto all yourPainter::rectcalls #5648 StrokeKind::defaultwas removed, since the 'normal' value depends on the context #5658- You probably want to use
StrokeKind::Insidewhen drawing rectangles - You probably want to use
StrokeKind::Middlewhen drawing open paths
- You probably want to use
- Rename
RoundingtoCornerRadius#5673 CornerRadius,MarginandShadowhave been updated to usei8andu8#5563, #5567, #5568- Remove the .0 from your values
- Cast dynamic values with
as i8/as u8oras _if you want Rust to infer the type- Rust will do a 'saturating' cast, so if your
f32value is bigger than127it will be clamped to127
- Rust will do a 'saturating' cast, so if your
RectShapeparameters changed #5565- Prefer to use the builder methods to create it instead of initializing it directly
Framenow takes theStrokewidth into account for its sizing, so check all views of your app to make sure they still look right. Read the PR for more info.
- Add
egui::Scenefor panning/zooming aUi#5505 by @grtlr - Animated WebP support #5470 by @Aely0
- Improve tessellation quality #5669 by @emilk
- Add
OutputCommandfor copying text and opening URL:s #5532 by @emilk - Add
Context::copy_image#5533 by @emilk - Add
WidgetType::ImageandImage::alt_text#5534 by @lucasmerlin - Add
epaint::Brushfor controllingRectShapetexturing #5565 by @emilk - Implement
nohash_hasher::IsEnabledforId#5628 by @emilk - Add keys for
!,{,}#5548 by @Its-Just-Nans - Add
RectShape::stroke_kindto control if stroke is inside/outside/centered #5647 by @emilk
⚠️ Framenow includes stroke width as part of padding #5575 by @emilk- Rename
RoundingtoCornerRadius#5673 by @emilk - Require a
StrokeKindwhen painting rectangles with strokes #5648 by @emilk - Round widget coordinates to even multiple of 1/32 #5517 by @emilk
- Make all lines and rectangles crisp #5518 by @emilk
- Tweak window resize handles #5524 by @emilk
- Use correct minimum version of
profilingcrate #5494 by @lucasmerlin - Fix interactive widgets sometimes being incorrectly marked as hovered #5523 by @emilk
- Fix panic due to non-total ordering in
Area::compare_order()#5569 by @HactarCE - Fix hovering through custom menu button #5555 by @M4tthewDE
- Use
u8inCornerRadius, and introduceCornerRadiusF32#5563 by @emilk - Store
Marginusingi8to reduce its size #5567 by @emilk - Shrink size of
Shadowby usingi8/u8instead off32#5568 by @emilk - Avoid allocations for loader cache lookup #5584 by @mineichen
- Use bitfield instead of bools in
ResponseandSense#5556 by @polwel
0.30.0 - egui_kittest and modals
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.
This release welcomes a new crate to the family: egui_kittest. egui_kittest is a testing framework for egui, allowing you to test both automation (simulated clicks and other events), and also do screenshot testing (useful for regression tests). egui_kittest is built using kittest, which is a general GUI testing framework that aims to work with any Rust GUI (not just egui!). kittest uses the accessibility library AccessKit for automatation and to query the widget tree.
kittest and egui_kittest are written by @lucasmerlin.
Here's a quick example of how to use egui_kittest to test a checkbox:
use egui::accesskit::Toggled;
use egui_kittest::{Harness, kittest::Queryable};
fn main() {
let mut checked = false;
let app = |ui: &mut egui::Ui| {
ui.checkbox(&mut checked, "Check me!");
};
let mut harness = egui_kittest::Harness::new_ui(app);
let checkbox = harness.get_by_label("Check me!");
assert_eq!(checkbox.toggled(), Some(Toggled::False));
checkbox.click();
harness.run();
let checkbox = harness.get_by_label("Check me!");
assert_eq!(checkbox.toggled(), Some(Toggled::True));
// You can even render the ui and do image snapshot tests
#[cfg(all(feature = "wgpu", feature = "snapshot"))]
harness.wgpu_snapshot("readme_example");
}
- Add
Modal, a popup that blocks input to the rest of the application (#5358 by @lucasmerlin) - Improved support for transform layers (#5465, #5468, #5429)
- Add
ModalandMemory::set_modal_layer#5358 by @lucasmerlin - Add
UiBuilder::layer_idand removelayer_idfromUi::new#5195 by @emilk - Allow easier setting of background color for
TextEdit#5203 by @bircni - Set
Response::intrinsic_sizeforTextEdit#5266 by @lucasmerlin - Expose center position in
MultiTouchInfo#5247 by @lucasmerlin Context::add_font#5228 by @frederik-uni- Impl from
Box<str>forWidgetText,RichText#5309 by @dimtpap - Add
Window::scroll_bar_visibility#5231 by @Zeenobit - Add
ComboBox::close_behavior#5305 by @avalsch - Add
painter.line()#5291 by @bircni - Allow attaching custom user data to a screenshot command #5416 by @emilk
- Add
Button::image_tint_follows_text_color#5430 by @emilk - Consume escape keystroke when bailing out from a drag operation #5433 by @abey79
- Add
Context::layer_transform_to_global&layer_transform_from_global#5465 by @emilk
- Update MSRV to Rust 1.80 #5421, #5457 by @emilk
- Expand max font atlas size from 8k to 16k #5257 by @rustbasic
- Put font data into
Arcto reduce memory consumption #5276 by @StarStarJ - Move
egui::util::cachetoegui::cache; addFramePublisher#5426 by @emilk - Remove
Order::PanelResizeLine#5455 by @emilk - Drag-and-drop: keep cursor set by user, if any #5467 by @abey79
- Use
profilingcrate to support more profiler backends #5150 by @teddemunnik - Improve hit-test of thin widgets, and widgets across layers #5468 by @emilk
- Update
ScrollAreadrag velocity when drag stopped #5175 by @valadaptive - Fix bug causing wrong-fire of
ViewportCommand::Visible#5244 by @rustbasic - Fix:
Ui::new_childdoes not consider thesizing_passfield ofUiBuilder#5262 by @zhatuokun - Fix Ctrl+Shift+Z redo shortcut #5258 by @YgorSouza
- Fix:
Window::default_posdoes not work #5315 by @rustbasic - Fix:
Sidesdid not apply the layout position correctly #5303 by @zhatuokun - Respect
Style::override_font_idinRichText#5310 by @MStarha - Fix disabled widgets "eating" focus #5370 by @lucasmerlin
- Fix cursor clipping in
TextEditinside aScrollArea#3660 by @juancampa - Make text cursor always appear on click #5420 by @juancampa
- Fix
on_hover_text_at_pointerfor transformed layers #5429 by @emilk - Fix: don't interact with
Areaoutside itsconstrain_rect#5459 by @MScottMcBee - Fix broken images on egui.rs (move from git lfs to normal git) #5480 by @emilk
- Fix:
ui.new_childshould now respectdisabled#5483 by @emilk - Fix zero-width strokes still affecting the feathering color of boxes #5485 by @emilk
BREAKING: you now need to enable the wayland and/or x11 features to get Linux support, including getting it to work on most CI systems.
- Support
ViewportCommand::Screenshoton web #5438 by @lucasmerlin
- Android support #5318 by @parasyte
- Update MSRV to 1.80 #5457 by @emilk
- Use
profilingcrate to support more profiler backends #5150 by @teddemunnik - Update glow to 0.16 #5395 by @sagudev
- Forward
x11andwaylandfeatures toglutin#5391 by @e00E
- iOS: Support putting UI next to the dynamic island #5211 by @frederik-uni
- Prevent panic when copying text outside of a secure context #5326 by @YgorSouza
- Fix accidental change of
FallbackEgltoPreferEgl#5408 by @e00E
0.29.1 - Bug fixes
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.
0.29.0 - Multipass, `UiBuilder`, & visual improvements
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.
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)
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
- 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
- Optimize
Color32::from_rgba_unmultipliedwith LUT #5088 by @YgorSouza
- 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
- 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
WebRunner::startnow expects aHtmlCanvasElementrather than the id of it (#4780)NativeOptions::follow_system_themeanddefault_themeis gone, and is now inegui::Optionsinstead (#4860)
- Conditionally propagate web events using a filter in WebOptions #5056 by @liamrosenfeld
- 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
- 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