Skip to main content

Dialog

Struct Dialog 

Source
pub struct Dialog<'a> {
Show 22 fields pub title: &'a str, pub message: &'a str, pub dialog_type: DialogType, pub buttons: Vec<&'a str>, pub selected_button: usize, pub width_percent: f32, pub height_percent: f32, pub footer: Option<&'a str>, pub footer_style: Style, pub title_inside: bool, pub overlay: bool, pub overlay_style: Style, pub border_color: Option<Color>, pub style: Style, pub button_selected_style: Style, pub button_style: Style, pub button_areas: Vec<Rect>, pub theme_info_color: Option<Color>, pub theme_success_color: Option<Color>, pub theme_warning_color: Option<Color>, pub theme_error_color: Option<Color>, pub theme_confirm_color: Option<Color>,
}
Available on crate feature dialog only.

Fields§

§title: &'a str§message: &'a str§dialog_type: DialogType§buttons: Vec<&'a str>§selected_button: usize§width_percent: f32§height_percent: f32§footer: Option<&'a str>§footer_style: Style§title_inside: bool§overlay: bool§overlay_style: Style§border_color: Option<Color>§style: Style§button_selected_style: Style§button_style: Style§button_areas: Vec<Rect>§theme_info_color: Option<Color>§theme_success_color: Option<Color>§theme_warning_color: Option<Color>§theme_error_color: Option<Color>§theme_confirm_color: Option<Color>

Implementations§

Source§

impl<'a> Dialog<'a>

Source

pub fn new(title: &'a str, message: &'a str) -> Dialog<'a>

Source

pub fn info(title: &'a str, message: &'a str) -> Dialog<'a>

Source

pub fn warning(title: &'a str, message: &'a str) -> Dialog<'a>

Source

pub fn error(title: &'a str, message: &'a str) -> Dialog<'a>

Source

pub fn success(title: &'a str, message: &'a str) -> Dialog<'a>

Source

pub fn confirm(title: &'a str, message: &'a str) -> Dialog<'a>

Source

pub fn dialog_type(self, dialog_type: DialogType) -> Dialog<'a>

Source

pub fn buttons(self, buttons: Vec<&'a str>) -> Dialog<'a>

Source

pub fn style(self, style: Style) -> Dialog<'a>

Source

pub fn border_color(self, border_color: Color) -> Dialog<'a>

Source

pub fn width_percent(self, width_percent: f32) -> Dialog<'a>

Source

pub fn height_percent(self, height_percent: f32) -> Dialog<'a>

Source

pub fn footer(self, footer: &'a str) -> Dialog<'a>

Source

pub fn footer_style(self, footer_style: Style) -> Dialog<'a>

Source

pub fn title_inside(self, title_inside: bool) -> Dialog<'a>

Source

pub fn overlay(self, overlay: bool) -> Dialog<'a>

Source

pub fn overlay_style(self, overlay_style: Style) -> Dialog<'a>

Source

pub fn button_selected_style(self, button_selected_style: Style) -> Dialog<'a>

Source

pub fn button_style(self, button_style: Style) -> Dialog<'a>

Source§

impl<'a> Dialog<'a>

Source

pub fn get_selected_button(&self) -> usize

Source

pub fn get_selected_button_text(&self) -> Option<&str>

Source

pub fn get_border_color(&self) -> Color

Source

pub fn select_next_button(&mut self)

Source

pub fn select_previous_button(&mut self)

Source

pub fn handle_click(&self, column: u16, row: u16) -> Option<usize>

Auto Trait Implementations§

§

impl<'a> Freeze for Dialog<'a>

§

impl<'a> RefUnwindSafe for Dialog<'a>

§

impl<'a> Send for Dialog<'a>

§

impl<'a> Sync for Dialog<'a>

§

impl<'a> Unpin for Dialog<'a>

§

impl<'a> UnsafeUnpin for Dialog<'a>

§

impl<'a> UnwindSafe for Dialog<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more