Skip to content

Commit

Permalink
Fix/improve UiKind
Browse files Browse the repository at this point in the history
  • Loading branch information
abey79 committed Nov 29, 2024
1 parent 809df1f commit 64c0c62
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/egui/src/ui_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ impl UiKind {
| Self::RightPanel
| Self::TopPanel
| Self::BottomPanel
| Self::Modal
| Self::Frame
| Self::ScrollArea
| Self::Resize
| Self::TableCell => false,

Self::Window
| Self::Menu
| Self::Modal
| Self::Popup
| Self::Tooltip
| Self::Picker
Expand Down Expand Up @@ -232,6 +232,12 @@ impl UiStack {
self.kind().map_or(false, |kind| kind.is_panel())
}

/// Is this [`crate::Ui`] an [`crate::Area`]?
#[inline]
pub fn is_area_ui(&self) -> bool {
self.kind().map_or(false, |kind| kind.is_area())
}

/// Is this a root [`crate::Ui`], i.e. created with [`crate::Ui::new()`]?
#[inline]
pub fn is_root_ui(&self) -> bool {
Expand Down

0 comments on commit 64c0c62

Please sign in to comment.