diff --git a/crates/egui/src/containers/modal.rs b/crates/egui/src/containers/modal.rs index 218bfce3..2edc628e 100644 --- a/crates/egui/src/containers/modal.rs +++ b/crates/egui/src/containers/modal.rs @@ -4,11 +4,14 @@ use crate::{ use emath::{Align2, Vec2}; /// A modal dialog. +/// /// Similar to a [`crate::Window`] but centered and with a backdrop that /// blocks input to the rest of the UI. /// /// You can show multiple modals on top of each other. The topmost modal will always be /// the most recently shown one. +/// If multiple modals are newly shown in the same frame, the order of the modals not undefined +/// (either first or second could be top). pub struct Modal { pub area: Area, pub backdrop_color: Color32, @@ -16,7 +19,9 @@ pub struct Modal { } impl Modal { - /// Create a new Modal. The id is passed to the area. + /// Create a new Modal. + /// + /// The id is passed to the area. pub fn new(id: Id) -> Self { Self { area: Self::default_area(id), @@ -26,6 +31,7 @@ impl Modal { } /// Returns an area customized for a modal. + /// /// Makes these changes to the default area: /// - sense: hover /// - anchor: center diff --git a/crates/egui/src/containers/popup.rs b/crates/egui/src/containers/popup.rs index 70050062..a2b668ff 100644 --- a/crates/egui/src/containers/popup.rs +++ b/crates/egui/src/containers/popup.rs @@ -8,6 +8,7 @@ use emath::{vec2, Align, Pos2, Rect, RectAlign, Vec2}; use std::iter::once; /// What should we anchor the popup to? +/// /// The final position for the popup will be calculated based on [`RectAlign`] /// and can be customized with [`Popup::align`] and [`Popup::align_alternatives`]. /// [`PopupAnchor`] is the parent rect of [`RectAlign`].