pub struct DialogSpec {
pub dialog: Dialog,
pub closable: bool,
pub movable: bool,
pub backdrop: Backdrop,
pub remember: Option<String>,
}Expand description
A dialog and how it is presented around its content: what
Dialogs::open takes (any dialog converts into one, presented by
default).
use egui_pop_api::dialogs::{Backdrop, DialogSpec, Info};
let spec = DialogSpec::new(Info::new("Saved", "The document was saved.")).closable(true);
assert!(spec.closable);
let spec = DialogSpec::new(Info::new("Levels", "Drag to adjust."))
.movable(true)
.backdrop(Backdrop::Clear)
.remember_position("levels");
assert_eq!(spec.remember.as_deref(), Some("levels"));Fields§
§dialog: Dialog§closable: boolA ✕ at the right end of the title row, doing what Escape does
(off by default; the SETTING_CLOSABLE setting turns it on for
every dialog).
movable: boolA header band to drag the dialog by (off by default; the
SETTING_MOVABLE setting turns it on for every dialog).
backdrop: BackdropWhat the dialog does to the interface behind it.
remember: Option<String>The key the dialog’s place is kept under: it comes up where it was left instead of centred.
Implementations§
Source§impl DialogSpec
impl DialogSpec
pub fn new(dialog: impl Into<Dialog>) -> Self
Sourcepub fn closable(self, closable: bool) -> Self
pub fn closable(self, closable: bool) -> Self
With the close button (a notice without Cancel, an application following the web’s convention).
Sourcepub fn movable(self, movable: bool) -> Self
pub fn movable(self, movable: bool) -> Self
With a header band to drag it by (a dialog hiding what it acts on).
Sourcepub fn backdrop(self, backdrop: Backdrop) -> Self
pub fn backdrop(self, backdrop: Backdrop) -> Self
What it does to the interface behind it (Backdrop::Dim by
default).
Sourcepub fn remember_position(self, key: &str) -> Self
pub fn remember_position(self, key: &str) -> Self
Comes up where it was last left, kept under key (letters,
digits, . _ - :) in the host’s store; otherwise centred.
Trait Implementations§
Source§impl Clone for DialogSpec
impl Clone for DialogSpec
Source§fn clone(&self) -> DialogSpec
fn clone(&self) -> DialogSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DialogSpec
impl Debug for DialogSpec
Source§impl From<Choose> for DialogSpec
impl From<Choose> for DialogSpec
Source§impl From<Confirm> for DialogSpec
impl From<Confirm> for DialogSpec
Source§impl From<Custom> for DialogSpec
impl From<Custom> for DialogSpec
Source§impl From<Dialog> for DialogSpec
impl From<Dialog> for DialogSpec
Source§impl From<Form> for DialogSpec
impl From<Form> for DialogSpec
Source§impl From<Info> for DialogSpec
impl From<Info> for DialogSpec
Source§impl PartialEq for DialogSpec
impl PartialEq for DialogSpec
impl StructuralPartialEq for DialogSpec
Auto Trait Implementations§
impl Freeze for DialogSpec
impl RefUnwindSafe for DialogSpec
impl Send for DialogSpec
impl Sync for DialogSpec
impl Unpin for DialogSpec
impl UnsafeUnpin for DialogSpec
impl UnwindSafe for DialogSpec
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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