pub struct Dialog {
pub open: bool,
pub submitted: bool,
pub working_input: String,
pub submitted_input: String,
/* private fields */
}Expand description
The data structure for the dialog.
Fields§
§open: boolWhether or not the dialog box is open.
submitted: boolWhether or not input has been submitted.
working_input: StringThe text being written into the dialog box when it’s open. This field can be used to
pre-populate the dialog with a value before it is opened. It will be cleared when the
user presses Esc or Enter.
submitted_input: StringThe text that has been written and is submitted for use when the user presses Enter. Any
surrounding whitespace will be trimmed.
Implementations§
Source§impl Dialog
impl Dialog
Sourcepub fn key_action(&mut self, key_code: &KeyCode)
pub fn key_action(&mut self, key_code: &KeyCode)
Respond to key press.
Sourcepub fn title_top(&mut self, title: &str) -> Self
pub fn title_top(&mut self, title: &str) -> Self
Set the top title of the block surrounding the widget.
If the method is not used, there will be no top title.
Sourcepub fn title_bottom(&mut self, title: &str) -> Self
pub fn title_bottom(&mut self, title: &str) -> Self
Set the bottom title of the block surrounding the widget.
If the method is not used, the bottom title will default to BOTTOM_TITLE.
Sourcepub fn borders(&mut self, borders: Borders) -> Self
pub fn borders(&mut self, borders: Borders) -> Self
Set borders of the block surrounding the widget.
If the method is not used, the borders will default to ratatui::widgets::Borders::ALL.
Sourcepub fn style(&mut self, style: Style) -> Self
pub fn style(&mut self, style: Style) -> Self
Set the style of the widget.
If the method is not used, the style will be the default with a
ratatui::style::Color::DarkGray background.
Trait Implementations§
impl StructuralPartialEq for Dialog
Auto Trait Implementations§
impl Freeze for Dialog
impl RefUnwindSafe for Dialog
impl Send for Dialog
impl Sync for Dialog
impl Unpin for Dialog
impl UnwindSafe for Dialog
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