pub enum Modality {
Owned,
Modal,
Independent,
}Expand description
How a secondary window relates to the one that opened it.
How much of this the platform will actually enforce differs sharply: Windows
does all of it, macOS keeps the z-order and blocks nothing, and X11 and Wayland
offer neither through winit. So the one guarantee that holds everywhere is
Modal input blocking, because the runner does that itself
rather than asking. The rest is appearance, and the crate’s README has the
table.
Variants§
Owned
Above its owner, closed with it, and input still reaches both.
The default, and what a settings form or an “edit details” window wants: a window belonging to this application rather than a second application that happens to share a process. The user can keep working in the main window while it is open.
Modal
Owned, and the owner takes no input until this window closes.
The window-sized version of Ui::push_scene with a dim: a confirmation, a
wizard, anything the user must answer before going back. The owner keeps
drawing — animations there do not freeze — it simply stops listening, and
a press on it raises this window instead.
Independent
A window of its own, with no relationship to its opener at all.
A second document window, or a tool palette the user may want behind the main window. It does not close when its opener does, so an application that opens one is responsible for it — including for the fact that closing the main window ends the run and takes it down regardless.
Trait Implementations§
impl Copy for Modality
impl Eq for Modality
impl StructuralPartialEq for Modality
Auto Trait Implementations§
impl Freeze for Modality
impl RefUnwindSafe for Modality
impl Send for Modality
impl Sync for Modality
impl Unpin for Modality
impl UnsafeUnpin for Modality
impl UnwindSafe for Modality
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.