From 358f1ae92b7728e60ff351485679007d3f464408 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Fri, 29 Nov 2024 11:12:38 +0100 Subject: [PATCH] Add `UiKind::Modal` --- crates/egui/src/containers/modal.rs | 3 ++- crates/egui/src/ui_stack.rs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/containers/modal.rs b/crates/egui/src/containers/modal.rs index 25f3fbce7ca..e7180f7b7c7 100644 --- a/crates/egui/src/containers/modal.rs +++ b/crates/egui/src/containers/modal.rs @@ -1,5 +1,5 @@ use crate::{ - Area, Color32, Context, Frame, Id, InnerResponse, Order, Response, Sense, Ui, UiBuilder, + Area, Color32, Context, Frame, Id, InnerResponse, Order, Response, Sense, Ui, UiBuilder, UiKind, }; use emath::{Align2, Vec2}; @@ -32,6 +32,7 @@ impl Modal { /// - order: foreground pub fn default_area(id: Id) -> Area { Area::new(id) + .kind(UiKind::Modal) .sense(Sense::hover()) .anchor(Align2::CENTER_CENTER, Vec2::ZERO) .order(Order::Foreground) diff --git a/crates/egui/src/ui_stack.rs b/crates/egui/src/ui_stack.rs index 7aae3f2fbeb..44dc37af431 100644 --- a/crates/egui/src/ui_stack.rs +++ b/crates/egui/src/ui_stack.rs @@ -24,6 +24,9 @@ pub enum UiKind { /// A bottom [`crate::TopBottomPanel`]. BottomPanel, + /// A modal [`crate::Modal`]. + Modal, + /// A [`crate::Frame`]. Frame, @@ -75,6 +78,7 @@ impl UiKind { | Self::RightPanel | Self::TopPanel | Self::BottomPanel + | Self::Modal | Self::Frame | Self::ScrollArea | Self::Resize