pub struct ModalWidget<'a> { /* private fields */ }Expand description
Generic modal widget for buffer-based overlay rendering
Supports multiple modal types:
- List modals (file browser, prompt browser, etc.)
- Wizard modals (guided workflows with tabs)
- Text modals (informational messages)
- Search modals (with filtering)
- Secure prompt modals (password input)
§Example
ⓘ
ModalWidget::new(title, viewport)
.modal_state(modal_state)
.styles(styles)
.render(area, buf);Implementations§
Source§impl<'a> ModalWidget<'a>
impl<'a> ModalWidget<'a>
Sourcepub fn new(title: String, viewport: Rect) -> Self
pub fn new(title: String, viewport: Rect) -> Self
Create a new ModalWidget with required parameters
Sourcepub fn modal_type(self, modal_type: ModalType<'a>) -> Self
pub fn modal_type(self, modal_type: ModalType<'a>) -> Self
Set the modal type and content
Sourcepub fn styles(self, styles: ModalRenderStyles) -> Self
pub fn styles(self, styles: ModalRenderStyles) -> Self
Set the render styles
Sourcepub fn input_content(self, content: &'a str) -> Self
pub fn input_content(self, content: &'a str) -> Self
Set input content for secure prompts
Sourcepub fn cursor_position(self, position: usize) -> Self
pub fn cursor_position(self, position: usize) -> Self
Set cursor position for secure prompts
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ModalWidget<'a>
impl<'a> RefUnwindSafe for ModalWidget<'a>
impl<'a> Send for ModalWidget<'a>
impl<'a> Sync for ModalWidget<'a>
impl<'a> Unpin for ModalWidget<'a>
impl<'a> UnsafeUnpin for ModalWidget<'a>
impl<'a> !UnwindSafe for ModalWidget<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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