From 4bc7e6624507347fff453972f171ff4ec049f215 Mon Sep 17 00:00:00 2001 From: Alexander Parlett Date: Tue, 2 Apr 2024 09:33:14 +0100 Subject: [PATCH] Support order on windows (#4301) Adds support for the ordering of windows passing through to the underlying area. Needed for a specific usecase of adding debug tools using windows with the bevy integration. --- crates/egui/src/containers/window.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index 2b266dbd..0f336743 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -104,6 +104,13 @@ impl<'open> Window<'open> { self } + /// `order(Order::Foreground)` for a Window that should always be on top + #[inline] + pub fn order(mut self, order: Order) -> Self { + self.area = self.area.order(order); + self + } + /// Usage: `Window::new(…).mutate(|w| w.resize = w.resize.auto_expand_width(true))` // TODO(emilk): I'm not sure this is a good interface for this. #[inline]