Skip to content

Update Rust crate egui to 0.35#52

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/egui-0.x
Open

Update Rust crate egui to 0.35#52
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/egui-0.x

Conversation

@renovate

@renovate renovate Bot commented Nov 23, 2023

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Type Update Change
egui dependencies minor 0.290.35

Release Notes

emilk/egui (egui)

v0.35.0

Compare Source

Highlights
  • 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
Egui inspection and egui_mcp

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):

Screen.Recording.2026-06-25.at.19.58.20.15s.mov
Classes

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.

Better IME composition

IME visuals received an overhaul, they are now indicated by an underline and properly show the cursor during composition:

After-macOS-CMN-small.mp4
⭐ Added
🔧 Changed
🔥 Removed
🐛 Fixed

v0.34.3

Compare Source

v0.34.2

Compare Source

⭐ Added
🐛 Fixed
🚀 Performance

v0.34.1

Compare Source

Nothing new

v0.34.0

Compare Source

Highlights from this release
  • Sharper text unlocked by switching font rendering crate to skrifa
  • Fade out edges of ScrollAreas
  • Use Ui as the main entrypoint
Skrifa and font hinting

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 =):

Screen.Recording.2026-03-26.at.10.49.43.mov

We now support setting variable font parameters:

Screen.Recording.2026-03-26.at.11.37.21.mp4

(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)

More Ui, less Context

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.

Changed panel API

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.

⭐ Added
🔧 Changed
🔥 Removed
🐛 Fixed
🚀 Performance

v0.33.3

Compare Source

v0.33.2

Compare Source

⭐ Added
🔧 Changed
🐛 Fixed

v0.33.0

Compare Source

Highlights from this release:

  • egui::Plugin a improved way to create and access egui plugins
  • kitdiff, a viewer for egui_kittest image snapshots (and a general image diff tool)
  • better kerning
Improved 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:

Oct-09-2025 16-21-58

egui::Plugin trait

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.

kitdiff, a image diff viewer

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 files
  • kitdiff git will 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

Here is a video showing the kerning changes in kitdiff (try it yourself):

Screen.Recording.2025-10-09.at.13.43.19.mp4
Migration guide
  • egui::Mutex now has a timeout as a simple deadlock detection
    • If you use a egui::Mutex in 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)
  • screen_rect is deprecated
    • In order to support safe areas, egui now has viewport_rect and content_rect.
    • Update all usages of screen_rect to content_rect, unless you are sure that you want to draw outside the safe area (which would mean your Ui may be covered by notches, system ui, etc.)
⭐ Added
🔧 Changed
🔥 Removed
🐛 Fixed

v0.32.3

Compare Source

v0.32.2

Compare Source

v0.32.1

Compare Source

⭐ Added
🐛 Fixed

v0.32.0

Compare Source

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!

⚛️ Atoms

egui::Atom is the new, indivisible building blocks of egui (hence their name).
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:

Screen.Recording.2025-07-10.at.13.10.52.mov
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.

Details
❕ Improved popups, tooltips, and menus

Introduces a new egui::Popup api. Checkout the new demo on https://egui.rs:

Screen.Recording.2025-07-10.at.11.47.22.mov

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):

Screen.Recording.2025-07-10.at.11.36.29.mov

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().

Details
▲ Improved SVG support

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.

svg-scaling

Details
✨ Crisper graphics

Non-SVG icons are also rendered better, and text sharpness has been improved, especially in light mode.

image

Details
Migration guide

We have some silently breaking changes (code compiles fine but behavior changed) that require special care:

Menus close on click by default
  • 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:
          // 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 */ });
      You can also change the behavior only for a single SubMenu by using SubMenuButton, but by default it should be passed to any submenus when using MenuButton.
Memory::is_popup_open api now requires calls to Memory::keep_popup_open
  • The popup will immediately close if keep_popup_open is not called.
  • It's recommended to use the new Popup api 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(...)
        }
⭐ Other improvements
🔧 Changed

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.24 fix(deps): update rust crate egui to 0.25 Jan 8, 2024
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from ff44066 to 7c63400 Compare January 8, 2024 13:16
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.25 fix(deps): update rust crate egui to 0.26 Feb 5, 2024
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from 7c63400 to 4290b12 Compare February 5, 2024 16:57
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.26 fix(deps): update rust crate egui to 0.26 - autoclosed Mar 13, 2024
@renovate renovate Bot closed this Mar 13, 2024
@renovate
renovate Bot deleted the renovate/egui-0.x branch March 13, 2024 06:27
@renovate
renovate Bot restored the renovate/egui-0.x branch March 16, 2024 16:55
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.26 - autoclosed fix(deps): update rust crate egui to 0.26 Mar 16, 2024
@renovate renovate Bot reopened this Mar 16, 2024
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.26 fix(deps): update rust crate egui to 0.26 - autoclosed Mar 24, 2024
@renovate renovate Bot closed this Mar 24, 2024
@renovate
renovate Bot deleted the renovate/egui-0.x branch March 24, 2024 15:02
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.26 - autoclosed fix(deps): update rust crate egui to 0.26 Mar 26, 2024
@renovate renovate Bot reopened this Mar 26, 2024
@renovate
renovate Bot restored the renovate/egui-0.x branch March 26, 2024 20:30
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from 4290b12 to 4e5d7da Compare March 26, 2024 20:30
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.26 fix(deps): update rust crate egui to 0.27 Mar 26, 2024
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.27 fix(deps): update rust crate egui to 0.27.2 May 1, 2024
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch 2 times, most recently from 1586138 to 10da843 Compare May 5, 2024 10:54
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.27.2 fix(deps): update rust crate egui to 0.27 May 5, 2024
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from 10da843 to b7a54e6 Compare July 3, 2024 13:56
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.27 fix(deps): update rust crate egui to 0.28 Jul 3, 2024
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from b7a54e6 to af7b2a2 Compare July 16, 2024 06:46
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from af7b2a2 to c889b95 Compare September 26, 2024 14:13
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.28 fix(deps): update rust crate egui to 0.29 Sep 26, 2024
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.29 fix(deps): update rust crate egui to 0.30 Dec 16, 2024
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from c889b95 to 1a7f312 Compare December 16, 2024 19:09
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from 1a7f312 to 86421e4 Compare December 31, 2024 11:36
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.30 fix(deps): update rust crate egui to 0.31 Feb 4, 2025
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from 86421e4 to c4036a5 Compare February 4, 2025 17:26
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from c4036a5 to f7220fd Compare March 17, 2025 07:50
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.31 fix(deps): update rust crate egui to 0.32 Jul 10, 2025
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from f7220fd to e02917e Compare July 10, 2025 20:53
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from e02917e to 29809e4 Compare October 9, 2025 16:40
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.32 fix(deps): update rust crate egui to 0.33 Oct 9, 2025
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from 29809e4 to 40aafcd Compare March 26, 2026 12:42
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.33 fix(deps): update rust crate egui to 0.34 Mar 26, 2026
@renovate renovate Bot changed the title fix(deps): update rust crate egui to 0.34 Update Rust crate egui to 0.34 Apr 8, 2026
@renovate renovate Bot changed the title Update Rust crate egui to 0.34 Update Rust crate egui to 0.35 Jun 25, 2026
@renovate
renovate Bot force-pushed the renovate/egui-0.x branch from 40aafcd to 5272c76 Compare June 25, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants