Skip to content

egui 0.38.0 - `egui::EmbeddedView`

Latest

Choose a tag to compare

@lucasmerlin lucasmerlin released this 01 Dec 16:52
· 0 commits to main since this release


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

egui::EmbeddedView and egui_webview

EmbeddedWidget is a new utility widget that can be used to embed native ui inside an egui app. Examples for this could
be video players, a map view or webviews.

We are working on a WebView widget for egui over on our egui_crates repo.
Currently, it has support for using iframes on the web and chromium embedded on native. We're still working on a
macOS and Windows backend to use the system WebView engine there (WKWebView or WebView2), but for now chromium will
work everywhere.

There are two ways to show native views:

EmbeddedViewPlacement::Below

The egui surface needs to be transparent, and the native widget is rendered below egui. When placing the EmbeddedView,
a hole is cut into the egui surface, using Shape::Clear, so that the native view will show through.
PlatformOutput will contain a new EmbeddedViewOutput for each EmbeddedView. It's view_input_areas needs to be
used to pass input events through to the native widget below. On the web, eframe does this for us. Natively, this
has to be done by the native view implementation (e.g. in egui_webview).

EmbeddedViewPlacement::Above

Here, the native view is rendered above eguis surface. Again, we should EmbeddedViewOutput, but this time to clip the
native views painting to the view_paint_areas and its input to the view_input_areas.
This method has the drawback that any egui popups shown above the native view won't show their shadows or backdrops
in the area of the embedded widget. So it should only be used when the egui surface doesn't support transparency
(e.g. windows with vulkan or gl rendering) or if the native widget should support transparency.

Screen.Recording.2026-12-01.at.17.17.54.mov

⭐ Added

  • Add egui::EmbeddedView for easier integration of OS widgets #8854 by @lucasmerlin
  • focused_via: which FocusDirection gave the widget focus? #8878 by @lucasmerlin
  • Add Ui::resize_line_stroke for splitters and resize lines #8903 by @emilk
  • Add LayoutSection::wrap_indent for hanging indents #8939 by @emilk
  • Add CodeVisuals::stroke and TextFormat::background_stroke #8940 by @emilk
  • Add ViewportInfo::monitor_refresh_rate #8950 by @emilk
  • Add TableStyle with the colors of tables #8980 by @emilk
  • Add GridStyle #8989 by @emilk
  • Add lines, an outline, and rounded corners to egui_extras::Table #8983 by @emilk

🔧 Changed

  • Make the internals of ColorImage private #8714 by @emilk
  • Derive Copy for more small plain-data types #8869 by @emilk
  • Export types that were reachable but could not be named #8870 by @emilk
  • Make CollapsingHeader take atoms instead of WidgetText #8780 by @emilk
  • Make inline code prettier: rounded corners, padding, and text color #8872 by @emilk
  • Delay and fade in the hover highlight of resize lines and scroll bars #8902 by @emilk
  • Give Grid its own TableStyle, and stripe tables by default #8987 by @emilk
  • Pad Grid cells with TableStyle::cell_margin #8981 by @emilk
  • Allow child UIs to opt out of inherited sizing mode #8762 by @yay
  • Pad egui_extras::Table cells with TableStyle::cell_margin #8982 by @emilk
  • Snap the text of a TextEdit to the pixel grid #9000 by @emilk

🔥 Removed

🐛 Fixed

  • Purge stale entries from the debug Id and IdSalt source maps #8754 by @emilk
  • Sides: don't let the shrinking side paint over the other side #8783 by @emilk
  • Don't break lines at narrow no-break space (U+202F) or figure space (U+2007) #8845 by @emilk
  • Fix rendering with vello_cpu multithreading feature #8641 by @Quackdoc
  • Fix missing fullwidth forms and CJK punctuation from system fonts #8849 by @TakahiroNago
  • Fix the first frame's content_rect when the zoom factor is set before it #8892 by @atishay-kasliwal
  • Fix Escape not cancelling a DragValue edit with update_while_editing(false) #8924 by @d3bgger
  • Fix context menu closing when its widget is secondary-clicked again #8925 by @derekmwright
  • Fix CompletionPopup never coming back after Escape #8901 by @YashvanthSankar
  • Don't interrupt IME composition when re-requesting existing focus #8885 by @abdorah
  • Don't grow a window when its title bar icons are taller than the heading #8929 by @atishay-kasliwal
  • Fix panic in Context::fonts when called before first frame #8954 by @emilk
  • Resize CompletionPopup when the number of suggestions changes #8932 by @atishay-kasliwal
  • Window: apply current_pos in title-bar drag mode #8955 by @tyldx
  • Center singleline TextEdit text vertically by default #8993 by @emilk
  • Fix alignment of text inside atoms that are larger than the text #8997 by @emilk

🚀 Performance