Skip to main content

TextInputPopup

Struct TextInputPopup 

Source
pub struct TextInputPopup<'a> { /* private fields */ }
Expand description

Popup que envuelve un TextInput para capturar texto del usuario.

Compone un Popup (chrome) con un TextInput (campo de texto centrado). Hereda la configuración del TextInput a través de builders delegados.

El popup se auto-dimensiona según el alto requerido por el TextInput, y centra verticalmente el campo dentro del área disponible.

Implementations§

Source§

impl<'a> TextInputPopup<'a>

Source

pub fn new() -> Self

Crea un TextInputPopup con valores predeterminados.

Por defecto: Popup con borde redondeado y padding 0, TextInput con borders invisibles (Borders::NONE) y BorderType::None (la entrada se renderiza sin borde propio).

Source

pub fn title(self, title: &'a str) -> Self

Source

pub fn cursor_style(self, style: Style) -> Self

Source

pub fn text_style(self, style: Style) -> Self

Source

pub fn border_style(self, style: Style) -> Self

Source

pub fn borders(self, borders: Borders) -> Self

Source

pub fn input_bg_color(self, color: Color) -> Self

Background color for the inner TextInput content area. Use bg_color for the popup’s background instead.

Source

pub fn bg_color(self, color: Color) -> Self

Background color for the entire popup area (including border). Delegates to Popup::bg_color. See input_bg_color for the inner text input background.

Source

pub fn scroll_padding(self, padding: u16) -> Self

Source

pub fn scroll_reserve(self, reserve: u16) -> Self

Source

pub fn rows(self, rows: u16) -> Self

Source

pub fn placeholder(self, placeholder: &'a str) -> Self

Source

pub fn border_color(self, color: Color) -> Self

Source

pub fn border_type(self, bt: BorderType) -> Self

Source

pub fn width(self, w: PopupSize) -> Self

Source

pub fn height(self, h: PopupSize) -> Self

Source

pub fn position(self, x: u16, y: u16) -> Self

Source

pub fn origin(self, x: u16, y: u16) -> Self

Source

pub fn header(self) -> Self

Source

pub fn no_background(self) -> Self

Source

pub fn background_dots(self, color: Color, symbol: &str, density: u16) -> Self

Source

pub fn background_pattern(self, pattern: DotPattern) -> Self

Source

pub fn background_spacing(self, density_x: u16, density_y: u16) -> Self

Source

pub fn badges(self, badges: BadgeStack<'a>) -> Self

Source§

impl<'a> TextInputPopup<'a>

Source

pub fn resolve_rect(&self, area: Rect, state: &TextInputState) -> Rect

Resolves the final Rect for this popup within the given area, using the text input state for Auto-height resolution.

See AutoSized::auto_height.

Trait Implementations§

Source§

impl AutoSized for TextInputPopup<'_>

Source§

type State = TextInputState

Source§

fn auto_height(&self, _state: &Self::State, _area: Rect) -> u16

Returns the actual height this popup would render when its height is PopupSize::Auto, based on current content, state, and available area.
Source§

impl<'a> Clone for TextInputPopup<'a>

Source§

fn clone(&self) -> TextInputPopup<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl StatefulWidget for TextInputPopup<'_>

Source§

type State = TextInputState

State associated with the stateful widget. Read more
Source§

fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State)

Draws the current state of the widget in the given buffer. That is the only method required to implement a custom stateful widget.

Auto Trait Implementations§

§

impl<'a> Freeze for TextInputPopup<'a>

§

impl<'a> RefUnwindSafe for TextInputPopup<'a>

§

impl<'a> Send for TextInputPopup<'a>

§

impl<'a> Sync for TextInputPopup<'a>

§

impl<'a> Unpin for TextInputPopup<'a>

§

impl<'a> UnsafeUnpin for TextInputPopup<'a>

§

impl<'a> UnwindSafe for TextInputPopup<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.