pub struct DialogConfig {
pub title: String,
pub width_percent: u16,
pub height_percent: u16,
pub min_width: u16,
pub min_height: u16,
pub max_width: u16,
pub max_height: u16,
pub border_color: Color,
pub focused_border_color: Color,
pub close_on_escape: bool,
pub close_on_outside_click: bool,
pub buttons: Vec<(String, ContainerAction)>,
}Expand description
Configuration for a popup dialog.
Fields§
§title: StringDialog title.
width_percent: u16Width as percentage of screen (0-100).
height_percent: u16Height as percentage of screen (0-100).
min_width: u16Minimum width in columns.
min_height: u16Minimum height in rows.
max_width: u16Maximum width in columns.
max_height: u16Maximum height in rows.
border_color: ColorBorder color.
focused_border_color: ColorBorder color when focused.
close_on_escape: boolClose dialog on Escape.
close_on_outside_click: boolClose dialog when clicking outside.
Dialog buttons (label, action).
Implementations§
Source§impl DialogConfig
impl DialogConfig
Sourcepub fn width_percent(self, percent: u16) -> Self
pub fn width_percent(self, percent: u16) -> Self
Set the width percentage.
Sourcepub fn height_percent(self, percent: u16) -> Self
pub fn height_percent(self, percent: u16) -> Self
Set the height percentage.
Sourcepub fn border_color(self, color: Color) -> Self
pub fn border_color(self, color: Color) -> Self
Set the border color.
Sourcepub fn focused_border_color(self, color: Color) -> Self
pub fn focused_border_color(self, color: Color) -> Self
Set the focused border color.
Sourcepub fn close_on_escape(self, close: bool) -> Self
pub fn close_on_escape(self, close: bool) -> Self
Set close on escape behavior.
Sourcepub fn close_on_outside_click(self, close: bool) -> Self
pub fn close_on_outside_click(self, close: bool) -> Self
Set close on outside click behavior.
Set dialog buttons.
Add a single button.
Clear all buttons.
Trait Implementations§
Source§impl Clone for DialogConfig
impl Clone for DialogConfig
Source§fn clone(&self) -> DialogConfig
fn clone(&self) -> DialogConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DialogConfig
impl Debug for DialogConfig
Auto Trait Implementations§
impl Freeze for DialogConfig
impl RefUnwindSafe for DialogConfig
impl Send for DialogConfig
impl Sync for DialogConfig
impl Unpin for DialogConfig
impl UnwindSafe for DialogConfig
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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