pub struct OverlaySpec {
pub id: Id,
pub label: String,
pub kind: Kind,
pub dismiss_on_escape: bool,
pub dismiss_on_outside: bool,
pub width: Option<f32>,
pub offset: Vec2,
pub dim: f32,
pub resize: Option<ModalSize>,
}Expand description
An overlay as declared.
Fields§
§id: Id§label: StringWhat it is, for the debug bridge and accessibility.
kind: Kind§dismiss_on_escape: bool§dismiss_on_outside: bool§width: Option<f32>A modal’s width, when the dialog width token is too narrow (a settings window).
offset: Vec2A modal’s offset from the window’s centre, in points (a dialog moved by the user).
dim: f32How much of the theme’s backdrop a modal dims the interface with
(backdrop.opacity): 1 by default, 0 for none (the interface stays
as it is, still blocked).
resize: Option<ModalSize>A modal the person resizes; it then has the size asked, whatever
width says.
Implementations§
Source§impl OverlaySpec
impl OverlaySpec
pub fn new(id: impl Hash + Debug, label: &str, kind: Kind) -> Self
Sourcepub fn resizable(self, size: Vec2, min: Vec2) -> Self
pub fn resizable(self, size: Vec2, min: Vec2) -> Self
A modal the person resizes: opening at size (of its content, in
points), dragged by its edges and corners down to min and
within the window. It has that size whatever its content needs:
what does not fit is clipped, so add lays itself out in the
room it is given. width no longer counts, and only a modal can
be resized (a popover or a menu says so in the log and stays as
it is).
Sourcepub fn dim(self, dim: f32) -> Self
pub fn dim(self, dim: f32) -> Self
A modal dimming the interface with this share of the theme’s backdrop (0 to 1).
Sourcepub fn keep_on_escape(self) -> Self
pub fn keep_on_escape(self) -> Self
Escape does not close it (a modal waiting for an answer).
Trait Implementations§
Source§impl Clone for OverlaySpec
impl Clone for OverlaySpec
Source§fn clone(&self) -> OverlaySpec
fn clone(&self) -> OverlaySpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OverlaySpec
impl Debug for OverlaySpec
Source§impl PartialEq for OverlaySpec
impl PartialEq for OverlaySpec
Source§impl Serialize for OverlaySpec
impl Serialize for OverlaySpec
impl StructuralPartialEq for OverlaySpec
Auto Trait Implementations§
impl Freeze for OverlaySpec
impl RefUnwindSafe for OverlaySpec
impl Send for OverlaySpec
impl Sync for OverlaySpec
impl Unpin for OverlaySpec
impl UnsafeUnpin for OverlaySpec
impl UnwindSafe for OverlaySpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more