0.35.0 - Inspection, egui_mcp, classes and improved IME
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.
- New egui_mcp crate based on eguis new inspection protocol
- Set classes on your
Uis to modify widget behavior based on surrounding context - Improved IME
This release includes a new inspection protocol for egui. It allows reading the accesskit tree of a running app, as well as sending events to control it. It's implemented via a new InspectionPlugin in the egui_inspection crate. Eframe includes a new inspection feature. When enabled, you can enable inspection by launching the app with EGUI_INSPECTION=1. This will cause the app to listen on port 5719.
The first inspection protocol consumer is egui_mcp. It's a mcp server that allows your agent to see and use egui apps. It can be used to have the agent use the app, reproduce bugs and verify its changes. Install it via cargo install --git https://github.com/rerun-io/kittest_inspector egui_mcp and then add it to your agent via claude mcp add egui egui-mcp.
There is also a plan of adding a general inspection gui using the same protocol, that can e.g. be used to step through kittest tests frame by frame.
Here is claude using the mcp to try some of the egui demos (sped up by a lot, claude is slow):
https://github.com/user-attachments/assets/c3dd0456-acfc-428c-8efe-f4a244c9e3ba
- Add
egui_inspectionprotocol and plugin #8234 by @lucasmerlin
As part of css like styling, we've added classes to egui. You can already use them to e.g. modify widget behavior or styling based on surrounding context. Add classes to the container:
ui.scope_builder(UiBuilder::new().with_class("my_container"), |ui| {
...
});
In your widget, check if we're in my_container, to e.g. change sizes or colors:
let in_container = ui.stack().iter().any(|s| s.classes.has("my_container"));
Today this only works for custom widgets and ui code, but the next step will be a styling system that allows you to modify built in widget styling based on these classes.
- Add
ClassestoUiBuilderand some Widgets #7843 by @AdrienZianne
IME visuals received an overhaul, they are now indicated by an underline and properly show the cursor during composition:
https://github.com/user-attachments/assets/487c7e7c-ef6d-4a86-8dbc-8c71871b4470
- Add
ClassestoUiBuilderand some Widgets #7843 by @AdrienZianne - Drag-to-close panels #8182 by @emilk
- Add
AtomKind::Layout, for nestingAtomLayout#8219 by @lucasmerlin - Add
AtomLayout::direction#8221 by @lucasmerlin - Make the size of tabs and thin space configurable #8070 by @emilk
- Add
subpixel_binningtoTextOptionsandFontTweak#8072 by @emilk - Allow
AtomsinUi::small_button#8159 by @lucasmerlin - Atom support for
egui::WindowTitlebar #8154 by @lucasmerlin - Add
AsIdandIdSalt#8184 by @emilk - Add Context::set_cursor_image for OS-level custom cursors #8155 by @all3f0r1
- Add
ViewportBuilder::with_monitor+ViewportCommand::SetMonitor#8140 by @Le-Syl21 - Add modifier keys to
egui::Key#8127 by @Le-Syl21 - Expose interactive rects from the last pass #8211 by @psyche314
- Add
AtomLayout::selectablefor opt-in text selection #8224 by @akagifreeez - Add
LayoutJob::format_at_byte#8244 by @emilk - Add
atoms()helpers to getAtomsfrom widgets #8128 by @Nashvill375
- Improve IME handling, add public method
owns_ime_eventsonMemory#7983 by @umajho - Use
harfrustfor better kerning and ligatures #8031 by @gcailly - Rework
Windowmargins and setclip_rect_marginto zero #7725 by @emilk - Slide panels when animating them #8175 by @emilk
- Slow down animation time from 0.1s to 0.2s #8176 by @emilk
- Smoother CollapsingHeader animation #8177 by @emilk
- Drag-to-scroll: now only on touch screens #8181 by @emilk
Window: move only by dragging title bar #8183 by @emilk- Rename
Panelmethods #8192 by @emilk - Panels: double-click resize edge to toggle #8193 by @emilk
- Rename
AlphaFromCoveragetoFontColorTransferFunction#8201 by @emilk - Smoother collapsed-panel animation #8202 by @emilk
- Improve
Debug-formatting ofIdin debug-builds #8190 by @emilk - Use strongly typed
CharIndexandByteIndex+ bug fixes #8245 by @emilk - Allow downscaling image in
GetScreenshotinspection request #8248 by @lucasmerlin - Announce pressed state of selectable buttons to screen readers #8130 by @antoinecellerier
- Pre-populate font variation axes in the
FontTweakUI #8258 by @emilk - Make font hinting target configurable via
FontTweak#8262 by @emilk
- Remove everything that was marked
#[deprecated]#8105 by @emilk - Remove 64-bit atomics in main crate #8037 by @kay-lambdadelta
- Remove
impl Into<f32>arguments #8194 by @emilk
- Don't hide whitespaces in centered and right aligned text edits #8102 by @lucasmerlin
- Don't allow resizing past minimum content size #8152 by @lucasmerlin
- Fix resizing of
Grid#8170 by @lucasmerlin - Fix glyph caching on font variations #8189 by @emilk
Panel: never overflow available width, normax_width#8198 by @emilk- Fixes color picker hue drift at low alpha values #8208 by @aedm
- Fix: ScrollArea layout jitter with floating bars and zoom levels #7944 by @rustbasic
- Fix #2142 - lost_focus not firing after a mid-frame focus transfer #8210 by @ufoscout
- Fix label selection in deferred viewports #8242 by @yay
0.34.3: wgpu surface lifecycle 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 random hangs by improving
wgpu::Surfacelifecycle handling #8171 by @grtlr - Fix
ScrollArea::scroll_to_*calls whenstick_to_bottomis Active #8033 by @AmmarAbouZor
0.34.2: Text layout and selection 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 wrong color of last glyph of selected text #8075 by @emilk
- Fix text selection of centered and right-aligned text #8076 by @emilk
- Fix
Context::is_pointer_over_eguiandContext::egui_wants_pointer_input#8081 by @emilk - Fix centered & right aligned
TextEdit#8082 by @lucasmerlin
- Optimize text selection performance for large documents #7917 by @rustbasic
0.34.1: Enable WebGL fallback in eframe
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.34.0: More `Ui`, less `Context`
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.
- Sharper text unlocked by switching font rendering crate to
skrifa - Fade out edges of
ScrollAreas - Use
Uias the main entrypoint
The font rendering backend was switched from ab_glyph to skrifa + vello_cpu. This enabled us support font hinting and variations. It also paves the way for more font improvements in the future, like support for color emojis and adding helpers for variations like RichText::bold.
Font hinting makes text more clear (look at the =):
https://github.com/user-attachments/assets/ea9151ec-869f-4c05-ab59-836114683417
We now support setting variable font parameters:
https://github.com/user-attachments/assets/0febde1c-ebf6-4d85-8f96-86ec0f934ecf
(Unfortunately there is currently a bug with variations, meaning changing them live like this won't work in practise. There is a draft PR to fix it, but it didn't make the release)
- Replace ab_glyph with Skrifa + vello_cpu; enable font hinting #7694 by @valadaptive
- Add font variations API #7859 by @valadaptive
egui has long had a confusing overlap in responsibilities between Context and Ui. In particular, you could add panels to either one (or both!). In this release, we switch from having Context be the main entrypoint, and instead provide whole-app Ui. In egui we've replaced Context::run with Context::run_ui, and changed viewports to be given a &mut Ui instead of Context. In eframe we've deprecated App::update replaced it with App::ui (which provides a &mut Ui instead of a &Context).
In addition to this, Ui now derefs to Context, so all code like ui.ctx().input(…) can now be written ui.input(…). This means you are much less likely to have to use naked Contexts. Context can still be useful though, since they implement Clone and can be sent to other threads so you can call .request_repaint on them.
- Add
Context::run_ui#7736 by @emilk - Add
Deref<Target = Context>forUi#7770 by @emilk - Replace
App::updatewithfn logicandfn ui#7775 by @emilk - Rename
Context::styletoglobal_style; avoid confusion w/Ui::style#7772 by @emilk - Rename functions in
Contextto avoid confusion #7773 by @emilk - Viewports: give the caller a
Uiinstead ofContext#7779 by @emilk
As part of the above work, we have unified the panel API. SidePanel and TopBottomPanel are deprecated, replaced by a single Panel. Furthermore, it is now deprecated to use panels directly on Context. Use the show_inside functions instead, acting on Uis.
This unification and simplification will make it easier to maintain and improve panels going forward.
- Add
Panelto replaceSidePanelandTopBottomPanel#5659 by @sharky98 - Deprecate using
Paneldirectly on aContext#7781 by @emilk - Deprecate
CentralPanel::show#7783 by @emilk - Deprecate
Context::used_sizeandContext::available_rect#7788 by @emilk
- Add
is_scrolling/is_smooth_scrollingutil, checking for active scroll action #7669 by @IsseW - Allow multiple atoms in
Button::shortcut_textandright_text#7696 by @emilk - Add
ScrollArea::content_margin#7722 by @emilk - Per-widget style #7667 by @AdrienZianne
- Plugin: export
TypedPluginGuardandTypedPluginHandle#7780 by @apekros - Add
ViewportInfo::occludedandvisible#7948 by @emilk - Add
Atomprefix/suffix support toDragValue#7949 by @lucasmerlin ⚠️ Atom improvements:Atom::id,align,closure,max_size#7958 by @lucasmerlin- Add
DebugOptions::warn_if_rect_changes_id#7984 by @emilk TextEditAtomprefix/suffix #7587 by @lucasmerlin- Add
Button::left_text#7955 by @rustbasic - Add
Response::parent_id#8010 by @lucasmerlin - Add
Context::text_edit_focused#8014 by @emilk - Add
Context::time#8017 by @emilk - Add
Ui::is_tooltip#8016 by @emilk - Add
UiStack::bg_color#8020 by @emilk - Make
egui::IdSetpublic #8019 by @lucasmerlin - Add raw key methods to TypeIdMap #8007 by @AlexanderSchuetz97
- Remove
accesskitfeature and always depend onaccesskit#7701 by @emilk - Update MSRV from 1.88 to 1.92 #7793 by @JasperBRiedel
- Improve modifier handling when scrolling #7678 by @emilk
- Apply preferred font weight when loading variable fonts #7790 by @pmnxis
- Make scroll bars and resize splitters visible to accesskit #7804 by @emilk
- Allow moving existing widgets to the top of interaction stack #7805 by @emilk
- Slightly change interact behavior around thin splitters #7806 by @emilk
- Move window resize interaction to be over contents #7807 by @emilk
- Don't expand widgets on hover #7808 by @emilk
- Make
FrameCache::getreturn a reference instead of cloning the cached value #7834 by @KonaeAkira - Update selected dependencies #7920 by @oscargus
- Make
Galley::pos_from_layout_cursorpub#7864 by @dionb - Update accesskit to 0.24.0 (and related deps) #7850 by @delan
- Quit on Ctrl-Q #7985 by @emilk
- Fade out the edges of
ScrollAreas#8018 by @emilk
- Fix: ensure
CentralPanel::show_insideallocates space in parent #7778 by @emilk - Heed constrain rect when auto-positioning windows #7786 by @emilk
- Fix jitter when hovering edge of scroll area close to resize splitter #7803 by @emilk
- Don't focus Areas, Windows and ScrollAreas #7827 by @lucasmerlin
- Fix backspacing leaving last character in IME prediction not removed on macOS native and Safari #7810 by @umajho
- Implemented distance threshold for double/triple clicks #7817 by @bl4ze4447
- Fix
CentralPanel::show_inside_dynto roundpanel_rect#7868 by @ripopov - Stop ctrl+arrow etc from moving focus #7897 by @emilk
- Fix scroll area not consuming scroll events #7904 by @lucasmerlin
- Pass in an explicit id in
UiBuilder, to avoid wrapping passed in ids with Id::new() #7925 by @lucasmerlin - Fix crash when dragging a DragValue through small floats #7939 by @Fyrecean
- Fix emoji icon font #7940 by @Jhynjhiruu
- Fixes the overly aggressive overflow elision in
truncate()and similar for os scaling other than 100% #7867 by @RndUsr123 - Fix text color when selecting newline character #7951 by @emilk
- Fix: repaint on drag-and-drop files #7953 by @emilk
- Fix instable IDs following animated panels #7994 by @emilk
- Enables every combination of
TextEditandLayoutJobalignments #7831 by @RndUsr123 - Fix
horizontal_wrappingrow height after usingtext_edit_multiline#8000 by @optozorax - Fix menu keyboard toggle for open submenus #7957 by @fjkorf
- Fix:
Visuals::interact_cursorsupport inButton#7986 by @mango766
0.33.3 - Improve kittest and text selection
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.
- Treat
.as a word-splitter in text navigation #7741 by @emilk - Change text color of selected text #7691 by @emilk
- Enforce consistent snapshot updates #7744 by @lucasmerlin
kittest: add drag-and-drop helpers #7690 by @emilk
- Bump
ehttpto 0.6.0 #7757 by @jprochazk
0.33.2
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
Plugin::on_widget_under_pointerto support widget inspector #7652 by @juancampa - Add
Response::total_drag_deltaandPointerState::total_drag_delta#7708 by @emilk
- Improve accessibility and testability of
ComboBox#7658 by @lucasmerlin
- Fix
profiling::scopecompile error when profiling usingtracingbackend #7646 by @PPakalns - Fix edge cases in "smart aiming" in sliders #7680 by @emilk
- Hide scroll bars when dragging other things #7689 by @emilk
- Prevent widgets sometimes appearing to move relative to each other #7710 by @emilk
- Fix
ui.response().interact(Sense::click())being flakey #7713 by @lucasmerlin
- Fix jittering during window resize on MacOS for WGPU/Metal #7641 by @aspcartman
- Make sure
native_pixels_per_pointis set during app creation #7683 by @emilk
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