Skip to content

0.24.0 - Multi-viewport

Compare
Choose a tag to compare
@emilk emilk released this 23 Nov 15:28
· 414 commits to master 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/

code-example

✨ 0.24 Highlights

You can now spawn multiple native windows on supported backends (e.g. eframe), using the new viewport API (#3172).

You can easily zoom any egui app using Cmd+Plus, Cmd+Minus or Cmd+0, just like in a browser (#3608).

Scrollbars are now hidden by default until you hover the ScrollArea (#3539).

⭐ Added

  • Multiple viewports/windows #3172 (thanks @konkitoman!)
  • Introduce global zoom_factor #3608
  • Floating scroll bars #3539
  • Add redo support to Undoer #3478 (thanks @LoganDark!)
  • Add egui::Vec2b #3543
  • Add max Window size & other size helpers #3537 (thanks @arduano!)
  • Allow changing shape of slider handle #3429 (thanks @YgorSouza!)
  • RawInput::viewports contains a list of all viewports. Access the current one with ctx.input(|i| i.viewport())

🔧 Changed

  • Replace Id::null() with Id::NULL #3544
  • Update MSRV to Rust 1.72 #3595
  • Update puffin to 0.18 #3600

🐛 Fixed

  • Fix upside down slider in the vertical orientation #3424 (thanks @YgorSouza!)
  • Make slider step account for range start #3488 (thanks @YgorSouza!)
  • Fix rounding of ImageButton #3531 (thanks @chriscate!)
  • Fix naming: constraint_to -> constrain_to #3438 (thanks @rinde!)
  • Fix Shift+Tab behavior when no widget is focused #3498 (thanks @DataTriny!)
  • Fix scroll not sticking when scrollbar is hidden #3434 (thanks @LoganDark!)
  • Add #[inline] to all builder-pattern functions #3557
  • Properly reverse bool animation if value changes before it's finished #3577 (thanks @YgorSouza!)

⚠️ BREAKING

  • egui::gui_zoom::zoom_with_keyboard_shortcuts is gone, replaced with Options::zoom_with_keyboard, which is true by default
  • Spacing::scroll_bar_X has been moved to Spacing::scroll_bar.X
  • Context::set_pixels_per_point now calls Context::set_zoom_level, and it may make sense for you to call that directly instead
  • If you are using eframe, check out the breaking changes in the eframe changelog

For integrations

There are several changes relevant to integrations.

  • Added crate::RawInput::viewports with information about all active viewports
  • The repaint callback set by Context::set_request_repaint_callback now points to which viewport should be repainted
  • Context::run now returns a list of ViewportOutput in FullOutput which should result in their own independent windows
  • There is a new Context::set_immediate_viewport_renderer for setting up the immediate viewport integration
  • If you support viewports, you need to call Context::set_embed_viewports(false), or all new viewports will be embedded (the default behavior)