Skip to content

Commit 4fdc54d

Browse files
⬆️🦀 Update Rust crate egui to 0.32.0 (#137)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [egui](https://redirect.github.com/emilk/egui) | dependencies | minor | `0.31.1` -> `0.32.0` | --- ### Release Notes <details> <summary>emilk/egui (egui)</summary> ### [`v0.32.1`](https://redirect.github.com/emilk/egui/blob/HEAD/CHANGELOG.md#0321---2025-08-15---Misc-bug-fixes) [Compare Source](https://redirect.github.com/emilk/egui/compare/0.32.0...0.32.1) ##### ⭐ Added - Add `ComboBox::popup_style` [#&#8203;7360](https://redirect.github.com/emilk/egui/pull/7360) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) ##### 🐛 Fixed - Fix glyph rendering: clamp coverage to \[0, 1] [#&#8203;7415](https://redirect.github.com/emilk/egui/pull/7415) by [@&#8203;emilk](https://redirect.github.com/emilk) - Fix manual `Popup` not closing [#&#8203;7383](https://redirect.github.com/emilk/egui/pull/7383) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Fix `WidgetText::Text` ignoring fallback font and overrides [#&#8203;7361](https://redirect.github.com/emilk/egui/pull/7361) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Fix `override_text_color` priority [#&#8203;7439](https://redirect.github.com/emilk/egui/pull/7439) by [@&#8203;YgorSouza](https://redirect.github.com/YgorSouza) - Fix debug-panic in ScrollArea if contents fit without scrolling [#&#8203;7440](https://redirect.github.com/emilk/egui/pull/7440) by [@&#8203;YgorSouza](https://redirect.github.com/YgorSouza) ### [`v0.32.0`](https://redirect.github.com/emilk/egui/blob/HEAD/CHANGELOG.md#0320---2025-07-10---Atoms-popups-and-better-SVG-support) [Compare Source](https://redirect.github.com/emilk/egui/compare/0.31.1...0.32.0) 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 `Atom`s. 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: ```rs 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: ```rs 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 ```rs 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](https://redirect.github.com/lucasmerlin/hello_egui/tree/main/crates/egui_flex). ##### Details - Add `AtomLayout`, abstracting layouting within widgets [#&#8203;5830](https://redirect.github.com/emilk/egui/pull/5830) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Add `Galley::intrinsic_size` and use it in `AtomLayout` [#&#8203;7146](https://redirect.github.com/emilk/egui/pull/7146) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) ##### ❕ Improved popups, tooltips, and menus 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 `Window`s, `Collapsible`s, `Modal`s and `Popup`s 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 - Add `Popup` and `Tooltip`, unifying the previous behaviours [#&#8203;5713](https://redirect.github.com/emilk/egui/pull/5713) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Add `Ui::close` and `Response::should_close` [#&#8203;5729](https://redirect.github.com/emilk/egui/pull/5729) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - ⚠️ Improved menu based on `egui::Popup` [#&#8203;5716](https://redirect.github.com/emilk/egui/pull/5716) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Add a toggle for the compact menu style [#&#8203;5777](https://redirect.github.com/emilk/egui/pull/5777) by [@&#8203;s-nie](https://redirect.github.com/s-nie) - Use the new `Popup` API for the color picker button [#&#8203;7137](https://redirect.github.com/emilk/egui/pull/7137) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - ⚠️ Close popup if `Memory::keep_popup_open` isn't called [#&#8203;5814](https://redirect.github.com/emilk/egui/pull/5814) by [@&#8203;juancampa](https://redirect.github.com/juancampa) - Fix tooltips sometimes changing position each frame [#&#8203;7304](https://redirect.github.com/emilk/egui/pull/7304) by [@&#8203;emilk](https://redirect.github.com/emilk) - Change popup memory to be per-viewport [#&#8203;6753](https://redirect.github.com/emilk/egui/pull/6753) by [@&#8203;mkalte666](https://redirect.github.com/mkalte666) - Deprecate `Memory::popup` API in favor of new `Popup` API [#&#8203;7317](https://redirect.github.com/emilk/egui/pull/7317) by [@&#8203;emilk](https://redirect.github.com/emilk) ##### ▲ Improved SVG support You can render SVG in egui with ```rs 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`](https://docs.rs/egui_extras/latest/egui_extras/fn.install_image_loaders.html)). 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](https://redirect.github.com/user-attachments/assets/faf63f0c-0ff7-47a0-a4cb-7210efeccb72) ##### Details - Support text in SVGs [#&#8203;5979](https://redirect.github.com/emilk/egui/pull/5979) by [@&#8203;cernec1999](https://redirect.github.com/cernec1999) - Fix sometimes blurry SVGs [#&#8203;7071](https://redirect.github.com/emilk/egui/pull/7071) by [@&#8203;emilk](https://redirect.github.com/emilk) - Fix incorrect color fringe colors on SVG:s [#&#8203;7069](https://redirect.github.com/emilk/egui/pull/7069) by [@&#8203;emilk](https://redirect.github.com/emilk) - Make `Image::paint_at` pixel-perfect crisp for SVG images [#&#8203;7078](https://redirect.github.com/emilk/egui/pull/7078) by [@&#8203;emilk](https://redirect.github.com/emilk) ##### ✨ Crisper graphics Non-SVG icons are also rendered better, and text sharpness has been improved, especially in light mode. ![image](https://redirect.github.com/user-attachments/assets/7f370aaf-886a-423c-8391-c378849b63ca) ##### Details - Improve text sharpness [#&#8203;5838](https://redirect.github.com/emilk/egui/pull/5838) by [@&#8203;emilk](https://redirect.github.com/emilk) - Improve text rendering in light mode [#&#8203;7290](https://redirect.github.com/emilk/egui/pull/7290) by [@&#8203;emilk](https://redirect.github.com/emilk) - Improve texture filtering by doing it in gamma space [#&#8203;7311](https://redirect.github.com/emilk/egui/pull/7311) by [@&#8203;emilk](https://redirect.github.com/emilk) - Make text underline and strikethrough pixel perfect crisp [#&#8203;5857](https://redirect.github.com/emilk/egui/pull/5857) by [@&#8203;emilk](https://redirect.github.com/emilk) ##### 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`: ```rs // 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`: ```rs 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 - Add `Label::show_tooltip_when_elided` [#&#8203;5710](https://redirect.github.com/emilk/egui/pull/5710) by [@&#8203;bryceberger](https://redirect.github.com/bryceberger) - Deprecate `Ui::allocate_new_ui` in favor of `Ui::scope_builder` [#&#8203;5764](https://redirect.github.com/emilk/egui/pull/5764) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Add `expand_bg` to customize size of text background [#&#8203;5365](https://redirect.github.com/emilk/egui/pull/5365) by [@&#8203;MeGaGiGaGon](https://redirect.github.com/MeGaGiGaGon) - Add assert messages and print bad argument values in asserts [#&#8203;5216](https://redirect.github.com/emilk/egui/pull/5216) by [@&#8203;bircni](https://redirect.github.com/bircni) - Use `TextBuffer` for `layouter` in `TextEdit` instead of `&str` [#&#8203;5712](https://redirect.github.com/emilk/egui/pull/5712) by [@&#8203;kernelkind](https://redirect.github.com/kernelkind) - Add a `Slider::update_while_editing(bool)` API [#&#8203;5978](https://redirect.github.com/emilk/egui/pull/5978) by [@&#8203;mbernat](https://redirect.github.com/mbernat) - Add `Scene::drag_pan_buttons` option. Allows specifying which pointer buttons pan the scene by dragging [#&#8203;5892](https://redirect.github.com/emilk/egui/pull/5892) by [@&#8203;mitchmindtree](https://redirect.github.com/mitchmindtree) - Add `Scene::sense` to customize how `Scene` responds to user input [#&#8203;5893](https://redirect.github.com/emilk/egui/pull/5893) by [@&#8203;mitchmindtree](https://redirect.github.com/mitchmindtree) - Rework `TextEdit` arrow navigation to handle Unicode graphemes [#&#8203;5812](https://redirect.github.com/emilk/egui/pull/5812) by [@&#8203;MStarha](https://redirect.github.com/MStarha) - `ScrollArea` improvements for user configurability [#&#8203;5443](https://redirect.github.com/emilk/egui/pull/5443) by [@&#8203;MStarha](https://redirect.github.com/MStarha) - Add `Response::clicked_with_open_in_background` [#&#8203;7093](https://redirect.github.com/emilk/egui/pull/7093) by [@&#8203;emilk](https://redirect.github.com/emilk) - Add `Modifiers::matches_any` [#&#8203;7123](https://redirect.github.com/emilk/egui/pull/7123) by [@&#8203;emilk](https://redirect.github.com/emilk) - Add `Context::format_modifiers` [#&#8203;7125](https://redirect.github.com/emilk/egui/pull/7125) by [@&#8203;emilk](https://redirect.github.com/emilk) - Add `OperatingSystem::is_mac` [#&#8203;7122](https://redirect.github.com/emilk/egui/pull/7122) by [@&#8203;emilk](https://redirect.github.com/emilk) - Support vertical-only scrolling by holding down Alt [#&#8203;7124](https://redirect.github.com/emilk/egui/pull/7124) by [@&#8203;emilk](https://redirect.github.com/emilk) - Support for back-button on Android [#&#8203;7073](https://redirect.github.com/emilk/egui/pull/7073) by [@&#8203;ardocrat](https://redirect.github.com/ardocrat) - Select all text in DragValue when gaining focus via keyboard [#&#8203;7107](https://redirect.github.com/emilk/egui/pull/7107) by [@&#8203;Azkellas](https://redirect.github.com/Azkellas) - Add `Context::current_pass_index` [#&#8203;7276](https://redirect.github.com/emilk/egui/pull/7276) by [@&#8203;emilk](https://redirect.github.com/emilk) - Add `Context::cumulative_frame_nr` [#&#8203;7278](https://redirect.github.com/emilk/egui/pull/7278) by [@&#8203;emilk](https://redirect.github.com/emilk) - Add `Visuals::text_edit_bg_color` [#&#8203;7283](https://redirect.github.com/emilk/egui/pull/7283) by [@&#8203;emilk](https://redirect.github.com/emilk) - Add `Visuals::weak_text_alpha` and `weak_text_color` [#&#8203;7285](https://redirect.github.com/emilk/egui/pull/7285) by [@&#8203;emilk](https://redirect.github.com/emilk) - Add support for scrolling via accesskit / kittest [#&#8203;7286](https://redirect.github.com/emilk/egui/pull/7286) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Update area struct to allow force resizing [#&#8203;7114](https://redirect.github.com/emilk/egui/pull/7114) by [@&#8203;blackberryfloat](https://redirect.github.com/blackberryfloat) - Add `egui::Sides` `shrink_left` / `shrink_right` [#&#8203;7295](https://redirect.github.com/emilk/egui/pull/7295) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Set intrinsic size for Label [#&#8203;7328](https://redirect.github.com/emilk/egui/pull/7328) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) ##### 🔧 Changed - Raise MSRV to 1.85 [#&#8203;6848](https://redirect.github.com/emilk/egui/pull/6848) by [@&#8203;torokati44](https://redirect.github.com/torokati44), [#&#8203;7279](https://redirect.github.com/emilk/egui/pull/7279) by [@&#8203;emilk](https://redirect.github.com/emilk) - Set `hint_text` in `WidgetInfo` [#&#8203;5724](https://redirect.github.com/emilk/egui/pull/5724) by [@&#8203;bircni](https://redirect.github.com/bircni) - Implement `Default` for `ThemePreference` [#&#8203;5702](https://redirect.github.com/emilk/egui/pull/5702) by [@&#8203;MichaelGrupp](https://redirect.github.com/MichaelGrupp) - Align `available_rect` docs with the new reality after [#&#8203;4590](https://redirect.github.com/emilk/egui/issues/4590) [#&#8203;5701](https://redirect.github.com/emilk/egui/pull/5701) by [@&#8203;podusowski](https://redirect.github.com/podusowski) - Clarify platform-specific details for `Viewport` positioning [#&#8203;5715](https://redirect.github.com/emilk/egui/pull/5715) by [@&#8203;aspiringLich](https://redirect.github.com/aspiringLich) - Simplify the text cursor API [#&#8203;5785](https://redirect.github.com/emilk/egui/pull/5785) by [@&#8203;valadaptive](https://redirect.github.com/valadaptive) - Bump accesskit to 0.19 [#&#8203;7040](https://redirect.github.com/emilk/egui/pull/7040) by [@&#8203;valadaptive](https://redirect.github.com/valadaptive) - Better define the meaning of `SizeHint` [#&#8203;7079](https://redirect.github.com/emilk/egui/pull/7079) by [@&#8203;emilk](https://redirect.github.com/emilk) - Move all input-related options into `InputOptions` [#&#8203;7121](https://redirect.github.com/emilk/egui/pull/7121) by [@&#8203;emilk](https://redirect.github.com/emilk) - `Button` inherits the `alt_text` of the `Image` in it, if any [#&#8203;7136](https://redirect.github.com/emilk/egui/pull/7136) by [@&#8203;emilk](https://redirect.github.com/emilk) - Change API of `Tooltip` slightly [#&#8203;7151](https://redirect.github.com/emilk/egui/pull/7151) by [@&#8203;emilk](https://redirect.github.com/emilk) - Use Rust edition 2024 [#&#8203;7280](https://redirect.github.com/emilk/egui/pull/7280) by [@&#8203;emilk](https://redirect.github.com/emilk) - Change `ui.disable()` to modify opacity [#&#8203;7282](https://redirect.github.com/emilk/egui/pull/7282) by [@&#8203;emilk](https://redirect.github.com/emilk) - Make the font atlas use a color image [#&#8203;7298](https://redirect.github.com/emilk/egui/pull/7298) by [@&#8203;valadaptive](https://redirect.github.com/valadaptive) - Implement `BitOr` and `BitOrAssign` for `Rect` [#&#8203;7319](https://redirect.github.com/emilk/egui/pull/7319) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) ##### 🔥 Removed - Remove things that have been deprecated for over a year [#&#8203;7099](https://redirect.github.com/emilk/egui/pull/7099) by [@&#8203;emilk](https://redirect.github.com/emilk) - Remove `SelectableLabel` [#&#8203;7277](https://redirect.github.com/emilk/egui/pull/7277) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) ##### 🐛 Fixed - `Scene`: make `scene_rect` full size on reset [#&#8203;5801](https://redirect.github.com/emilk/egui/pull/5801) by [@&#8203;graydenshand](https://redirect.github.com/graydenshand) - `Scene`: `TextEdit` selection when placed in a `Scene` [#&#8203;5791](https://redirect.github.com/emilk/egui/pull/5791) by [@&#8203;karhu](https://redirect.github.com/karhu) - `Scene`: Set transform layer before calling user content [#&#8203;5884](https://redirect.github.com/emilk/egui/pull/5884) by [@&#8203;mitchmindtree](https://redirect.github.com/mitchmindtree) - Fix: transform `TextShape` underline width [#&#8203;5865](https://redirect.github.com/emilk/egui/pull/5865) by [@&#8203;emilk](https://redirect.github.com/emilk) - Fix missing repaint after `consume_key` [#&#8203;7134](https://redirect.github.com/emilk/egui/pull/7134) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Update `emoji-icon-font` with fix for fullwidth latin characters [#&#8203;7067](https://redirect.github.com/emilk/egui/pull/7067) by [@&#8203;emilk](https://redirect.github.com/emilk) - Mark all keys as released if the app loses focus [#&#8203;5743](https://redirect.github.com/emilk/egui/pull/5743) by [@&#8203;emilk](https://redirect.github.com/emilk) - Fix scroll handle extending outside of `ScrollArea` [#&#8203;5286](https://redirect.github.com/emilk/egui/pull/5286) by [@&#8203;gilbertoalexsantos](https://redirect.github.com/gilbertoalexsantos) - Fix `Response::clicked_elsewhere` not returning `true` sometimes [#&#8203;5798](https://redirect.github.com/emilk/egui/pull/5798) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Fix kinetic scrolling on touch devices [#&#8203;5778](https://redirect.github.com/emilk/egui/pull/5778) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Fix `DragValue` expansion when editing [#&#8203;5809](https://redirect.github.com/emilk/egui/pull/5809) by [@&#8203;MStarha](https://redirect.github.com/MStarha) - Fix disabled `DragValue` eating focus, causing focus to reset [#&#8203;5826](https://redirect.github.com/emilk/egui/pull/5826) by [@&#8203;KonaeAkira](https://redirect.github.com/KonaeAkira) - Fix semi-transparent colors appearing too bright [#&#8203;5824](https://redirect.github.com/emilk/egui/pull/5824) by [@&#8203;emilk](https://redirect.github.com/emilk) - Improve drag-to-select text (add margins) [#&#8203;5797](https://redirect.github.com/emilk/egui/pull/5797) by [@&#8203;hankjordan](https://redirect.github.com/hankjordan) - Fix bug in pointer movement detection [#&#8203;5329](https://redirect.github.com/emilk/egui/pull/5329) by [@&#8203;rustbasic](https://redirect.github.com/rustbasic) - Protect against NaN in hit-test code [#&#8203;6851](https://redirect.github.com/emilk/egui/pull/6851) by [@&#8203;Skgland](https://redirect.github.com/Skgland) - Fix image button panicking with tiny `available_space` [#&#8203;6900](https://redirect.github.com/emilk/egui/pull/6900) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Fix links and text selection in horizontal\_wrapped layout [#&#8203;6905](https://redirect.github.com/emilk/egui/pull/6905) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Fix `leading_space` sometimes being ignored during paragraph splitting [#&#8203;7031](https://redirect.github.com/emilk/egui/pull/7031) by [@&#8203;afishhh](https://redirect.github.com/afishhh) - Fix typo in deprecation message for `ComboBox::from_id_source` [#&#8203;7055](https://redirect.github.com/emilk/egui/pull/7055) by [@&#8203;aelmizeb](https://redirect.github.com/aelmizeb) - Bug fix: make sure `end_pass` is called for all loaders [#&#8203;7072](https://redirect.github.com/emilk/egui/pull/7072) by [@&#8203;emilk](https://redirect.github.com/emilk) - Report image alt text as text if widget contains no other text [#&#8203;7142](https://redirect.github.com/emilk/egui/pull/7142) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) - Slider: move by at least the next increment when using fixed\_decimals [#&#8203;7066](https://redirect.github.com/emilk/egui/pull/7066) by [@&#8203;0x53A](https://redirect.github.com/0x53A) - Fix crash when using infinite widgets [#&#8203;7296](https://redirect.github.com/emilk/egui/pull/7296) by [@&#8203;emilk](https://redirect.github.com/emilk) - Fix `debug_assert` triggered by `menu`/`intersect_ray` [#&#8203;7299](https://redirect.github.com/emilk/egui/pull/7299) by [@&#8203;emilk](https://redirect.github.com/emilk) - Change `Rect::area` to return zero for negative rectangles [#&#8203;7305](https://redirect.github.com/emilk/egui/pull/7305) by [@&#8203;emilk](https://redirect.github.com/emilk) ##### 🚀 Performance - Optimize editing long text by caching each paragraph [#&#8203;5411](https://redirect.github.com/emilk/egui/pull/5411) by [@&#8203;afishhh](https://redirect.github.com/afishhh) - Make `WidgetText` smaller and faster [#&#8203;6903](https://redirect.github.com/emilk/egui/pull/6903) by [@&#8203;lucasmerlin](https://redirect.github.com/lucasmerlin) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekend" (UTC), 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/cda-tum/mqt-naviz). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44MS4yIiwidXBkYXRlZEluVmVyIjoiNDEuODEuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicnVzdCJdfQ==--> --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Haag <[email protected]>
1 parent 88628d6 commit 4fdc54d

File tree

8 files changed

+341
-444
lines changed

8 files changed

+341
-444
lines changed

Cargo.lock

Lines changed: 309 additions & 406 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
1515

1616
[dependencies]
1717
constcat = "0.6.0"
18-
eframe = {version = "0.31.1", default-features = false, features = [
18+
eframe = {version = "0.32.0", default-features = false, features = [
1919
"accesskit", # Make egui compatible with screen readers. NOTE: adds a lot of dependencies.
2020
"default_fonts", # Embed the default egui fonts.
2121
"persistence", # Persist some data across starts
2222
"wgpu", # Use the wgpu rendering backend.
2323
"wayland",
2424
"x11",
2525
]}
26-
egui = "0.31.1"
27-
egui_extras = "0.31.1"
26+
egui = "0.32.0"
27+
egui_extras = "0.32.0"
2828
git-version = "0.3.9"
2929
konst = "0.3.16"
3030
log = "0.4"
@@ -36,7 +36,7 @@ naviz-repository = {workspace = true}
3636
naviz-state = {workspace = true}
3737
rfd = "0.15.0"
3838
serde = {version = "1.0", features = ["derive"]}
39-
wgpu = {version = "24", features = ["webgl"]}# Enable webgl-support in wgpu
39+
wgpu = {version = "25", features = ["webgl"]} # Enable webgl-support in wgpu
4040

4141
# native:
4242
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

gui/src/aspect_panel.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ impl AspectPanel {
5858
(self.left, content_size.y).into(),
5959
);
6060

61-
ui.allocate_new_ui(
61+
ui.scope_builder(
6262
UiBuilder::new().max_rect(content_rect.translate(self.space.min.to_vec2())),
6363
content,
6464
);
65-
ui.allocate_new_ui(
65+
ui.scope_builder(
6666
UiBuilder::new().max_rect(top_rect.translate(self.space.min.to_vec2())),
6767
top,
6868
);
69-
ui.allocate_new_ui(
69+
ui.scope_builder(
7070
UiBuilder::new().max_rect(right_rect.translate(self.space.min.to_vec2())),
7171
right,
7272
);
73-
ui.allocate_new_ui(
73+
ui.scope_builder(
7474
UiBuilder::new().max_rect(bottom_rect.translate(self.space.min.to_vec2())),
7575
bottom,
7676
);
77-
ui.allocate_new_ui(
77+
ui.scope_builder(
7878
UiBuilder::new().max_rect(left_rect.translate(self.space.min.to_vec2())),
7979
left,
8080
);

gui/src/menu.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,18 @@ impl MenuBar {
210210

211211
self.handle_clipboard(ctx, state, errors);
212212

213-
egui::menu::bar(ui, |ui| {
213+
egui::MenuBar::new().ui(ui, |ui| {
214214
ui.menu_button("File", |ui| {
215215
if ui.button("Open").clicked() {
216216
self.choose_file(FileType::Instructions, future_helper, MenuEvent::file_open);
217-
ui.close_menu();
217+
ui.close_kind(egui::UiKind::Menu);
218218
}
219219

220220
ui.menu_button("Import", |ui| {
221221
for import_format in IMPORT_FORMATS {
222222
if ui.button(import_format.name()).clicked() {
223223
self.current_import_options = Some((import_format.into(), None));
224-
ui.close_menu();
224+
ui.close_kind(egui::UiKind::Menu);
225225
}
226226
}
227227
});
@@ -234,7 +234,7 @@ impl MenuBar {
234234
ui.separator();
235235
if ui.button("Quit").clicked() {
236236
ctx.send_viewport_cmd(egui::ViewportCommand::Close);
237-
ui.close_menu();
237+
ui.close_kind(egui::UiKind::Menu);
238238
}
239239
}
240240
});
@@ -257,7 +257,7 @@ impl MenuBar {
257257
ui.menu_button("Help", |ui| {
258258
if ui.button("About").clicked() {
259259
self.about_open = true;
260-
ui.close_menu();
260+
ui.close_kind(egui::UiKind::Menu);
261261
}
262262
});
263263
});
@@ -479,12 +479,12 @@ mod selection_menu {
479479
ui.menu_button(M::NAME, |ui| {
480480
if ui.button("Open").clicked() {
481481
menu_bar.choose_file(M::FILE_TYPE, future_helper, MenuEvent::file_open);
482-
ui.close_menu();
482+
ui.close_kind(egui::UiKind::Menu);
483483
}
484484
#[cfg(not(target_arch = "wasm32"))]
485485
if ui.button("Import").clicked() {
486486
menu_bar.choose_file(M::FILE_TYPE, future_helper, MenuEvent::file_import);
487-
ui.close_menu();
487+
ui.close_kind(egui::UiKind::Menu);
488488
}
489489

490490
ui.separator();
@@ -544,7 +544,7 @@ mod selection_menu {
544544
.inner;
545545
if select_button.clicked() {
546546
actions.push(Action::Set(id.to_string()));
547-
ui.close_menu();
547+
ui.close_kind(egui::UiKind::Menu);
548548
}
549549

550550
// Render delete button
@@ -666,7 +666,7 @@ pub mod export {
666666
.clicked()
667667
{
668668
self.export_settings.show();
669-
ui.close_menu();
669+
ui.close_kind(egui::UiKind::Menu);
670670
}
671671
}
672672

renderer/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ version = "0.5.1"
1212
[dependencies]
1313
bytemuck = "1.18.0"
1414
glam = {version = "0.30.0", features = ["bytemuck"]}
15-
glyphon = "0.8"
15+
glyphon = "0.9"
1616
log = "0.4.22"
17-
naga_oil = "0.17"
17+
naga_oil = "0.18"
1818
naviz-state = {workspace = true}
19-
wgpu = {version = "24", default-features = false, features = ["wgsl", "naga-ir"]}
19+
wgpu = {version = "25", default-features = false, features = ["wgsl", "naga-ir"]}
2020

2121
[build-dependencies]
2222
ureq = "3.0.5"

renderer/src/component/primitive/text.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,9 @@ fn to_text_buffer(
233233
font_family: &str,
234234
) -> Buffer {
235235
let mut text_buffer = Buffer::new(font_system, Metrics::new(font_size, 1.2 * font_size));
236+
let attrs = Attrs::new().family(Family::Name(font_family));
236237
text_buffer.set_size(font_system, None, None);
237-
text_buffer.set_text(
238-
font_system,
239-
text,
240-
Attrs::new().family(Family::Name(font_family)),
241-
Shaping::Advanced,
242-
);
238+
text_buffer.set_text(font_system, text, &attrs, Shaping::Advanced);
243239
text_buffer.shape_until_scroll(font_system, false);
244240
text_buffer
245241
}

video/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ version = "0.3.1"
1212
[dependencies]
1313
naviz-animator = {workspace = true}
1414
naviz-renderer = {workspace = true}
15-
wgpu = {version = "24", default-features = false}
15+
wgpu = {version = "25", default-features = false}

video/src/lib.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@ async fn create_device() -> (Device, Queue) {
5050
.await
5151
.expect("No adapter");
5252
adapter
53-
.request_device(
54-
&DeviceDescriptor {
55-
label: Some("naviz video renderer"),
56-
required_features: Features::default(),
57-
required_limits: Limits::default(),
58-
memory_hints: MemoryHints::default(),
59-
},
60-
None,
61-
)
53+
.request_device(&DeviceDescriptor {
54+
label: Some("naviz video renderer"),
55+
required_features: Features::default(),
56+
required_limits: Limits::default(),
57+
memory_hints: MemoryHints::default(),
58+
trace: wgpu::Trace::default(),
59+
})
6260
.await
6361
.expect("Failed to create device")
6462
}
@@ -269,7 +267,7 @@ impl VideoExport {
269267
buffer_slice.map_async(MapMode::Read, move |result| {
270268
tx.send(result).unwrap();
271269
});
272-
self.device.poll(wgpu::MaintainBase::Wait);
270+
let _ = self.device.poll(wgpu::MaintainBase::Wait);
273271
rx.recv().unwrap().unwrap();
274272

275273
buffer_slice.get_mapped_range()

0 commit comments

Comments
 (0)