Skip to content

Commit

Permalink
Add UiKind::Modal
Browse files Browse the repository at this point in the history
  • Loading branch information
abey79 committed Nov 29, 2024
1 parent 10791cc commit 358f1ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/egui/src/containers/modal.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions crates/egui/src/ui_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ pub enum UiKind {
/// A bottom [`crate::TopBottomPanel`].
BottomPanel,

/// A modal [`crate::Modal`].
Modal,

/// A [`crate::Frame`].
Frame,

Expand Down Expand Up @@ -75,6 +78,7 @@ impl UiKind {
| Self::RightPanel
| Self::TopPanel
| Self::BottomPanel
| Self::Modal
| Self::Frame
| Self::ScrollArea
| Self::Resize
Expand Down

0 comments on commit 358f1ae

Please sign in to comment.