pub struct TextInput { /* private fields */ }Expand description
TextInput widget using FSM-driven Stateful for incremental updates
Implementations§
Source§impl TextInput
impl TextInput
Sourcepub fn new(data: Arc<Mutex<TextInputData>>) -> TextInput
pub fn new(data: Arc<Mutex<TextInputData>>) -> TextInput
Create a text input with externally-managed data state
pub fn w(self, px: f32) -> TextInput
pub fn w_full(self) -> TextInput
pub fn min_w(self, px: f32) -> TextInput
pub fn h(self, px: f32) -> TextInput
pub fn placeholder(self, text: impl Into<String>) -> TextInput
pub fn input_type(self, input_type: InputType) -> TextInput
pub fn disabled(self, disabled: bool) -> TextInput
pub fn masked(self, masked: bool) -> TextInput
pub fn max_length(self, max: usize) -> TextInput
Sourcepub fn text_size(self, size: f32) -> TextInput
pub fn text_size(self, size: f32) -> TextInput
Set the font size for the text input (default: 16.0)
pub fn rounded(self, radius: f32) -> TextInput
pub fn border(self, width: f32, color: Color) -> TextInput
pub fn border_color(self, color: Color) -> TextInput
pub fn border_width(self, width: f32) -> TextInput
pub fn shadow_sm(self) -> TextInput
pub fn shadow_md(self) -> TextInput
pub fn flex_grow(self) -> TextInput
Sourcepub fn id(self, id: &str) -> TextInput
pub fn id(self, id: &str) -> TextInput
Set the CSS element ID for stylesheet matching
When set, the TextInput will query the active stylesheet for
styles matching #id, #id:hover, #id:focus, #id:disabled,
and #id::placeholder.
Sourcepub fn idle_border_color(self, color: Color) -> TextInput
pub fn idle_border_color(self, color: Color) -> TextInput
Set the idle border color (when not hovered or focused)
Sourcepub fn hover_border_color(self, color: Color) -> TextInput
pub fn hover_border_color(self, color: Color) -> TextInput
Set the hover border color
Sourcepub fn focused_border_color(self, color: Color) -> TextInput
pub fn focused_border_color(self, color: Color) -> TextInput
Set the focused border color
Sourcepub fn error_border_color(self, color: Color) -> TextInput
pub fn error_border_color(self, color: Color) -> TextInput
Set the error border color (shown when is_valid is false)
Sourcepub fn border_colors(
self,
idle: Color,
hover: Color,
focused: Color,
error: Color,
) -> TextInput
pub fn border_colors( self, idle: Color, hover: Color, focused: Color, error: Color, ) -> TextInput
Set all border colors at once for consistent theming
Sourcepub fn idle_bg_color(self, color: Color) -> TextInput
pub fn idle_bg_color(self, color: Color) -> TextInput
Set the idle background color
Sourcepub fn hover_bg_color(self, color: Color) -> TextInput
pub fn hover_bg_color(self, color: Color) -> TextInput
Set the hover background color
Sourcepub fn focused_bg_color(self, color: Color) -> TextInput
pub fn focused_bg_color(self, color: Color) -> TextInput
Set the focused background color
Sourcepub fn bg_colors(self, idle: Color, hover: Color, focused: Color) -> TextInput
pub fn bg_colors(self, idle: Color, hover: Color, focused: Color) -> TextInput
Set all background colors at once
Sourcepub fn text_color(self, color: Color) -> TextInput
pub fn text_color(self, color: Color) -> TextInput
Set the text color
Sourcepub fn placeholder_color(self, color: Color) -> TextInput
pub fn placeholder_color(self, color: Color) -> TextInput
Set the placeholder text color
Sourcepub fn cursor_color(self, color: Color) -> TextInput
pub fn cursor_color(self, color: Color) -> TextInput
Set the cursor color
Sourcepub fn selection_color(self, color: Color) -> TextInput
pub fn selection_color(self, color: Color) -> TextInput
Set the selection highlight color
Trait Implementations§
Source§impl ElementBuilder for TextInput
impl ElementBuilder for TextInput
Source§fn build(&self, tree: &mut LayoutTree) -> LayoutNodeId
fn build(&self, tree: &mut LayoutTree) -> LayoutNodeId
Source§fn render_props(&self) -> RenderProps
fn render_props(&self) -> RenderProps
Source§fn children_builders(&self) -> &[Box<dyn ElementBuilder>]
fn children_builders(&self) -> &[Box<dyn ElementBuilder>]
Source§fn element_type_id(&self) -> ElementTypeId
fn element_type_id(&self) -> ElementTypeId
Source§fn semantic_type_name(&self) -> Option<&'static str>
fn semantic_type_name(&self) -> Option<&'static str>
Source§fn event_handlers(&self) -> Option<&EventHandlers>
fn event_handlers(&self) -> Option<&EventHandlers>
Source§fn layout_bounds_storage(&self) -> Option<Arc<Mutex<Option<ElementBounds>>>>
fn layout_bounds_storage(&self) -> Option<Arc<Mutex<Option<ElementBounds>>>>
Source§fn layout_bounds_callback(
&self,
) -> Option<Arc<dyn Fn(ElementBounds) + Send + Sync>>
fn layout_bounds_callback( &self, ) -> Option<Arc<dyn Fn(ElementBounds) + Send + Sync>>
Source§fn text_render_info(&self) -> Option<TextRenderInfo>
fn text_render_info(&self) -> Option<TextRenderInfo>
Source§fn styled_text_render_info(&self) -> Option<StyledTextRenderInfo>
fn styled_text_render_info(&self) -> Option<StyledTextRenderInfo>
Source§fn svg_render_info(&self) -> Option<SvgRenderInfo>
fn svg_render_info(&self) -> Option<SvgRenderInfo>
Source§fn image_render_info(&self) -> Option<ImageRenderInfo>
fn image_render_info(&self) -> Option<ImageRenderInfo>
Source§fn canvas_render_info(
&self,
) -> Option<Rc<dyn Fn(&mut dyn DrawContext, CanvasBounds)>>
fn canvas_render_info( &self, ) -> Option<Rc<dyn Fn(&mut dyn DrawContext, CanvasBounds)>>
Source§fn scroll_info(&self) -> Option<ScrollRenderInfo>
fn scroll_info(&self) -> Option<ScrollRenderInfo>
Source§fn scroll_physics(&self) -> Option<Arc<Mutex<ScrollPhysics>>>
fn scroll_physics(&self) -> Option<Arc<Mutex<ScrollPhysics>>>
Source§fn motion_animation_for_child(
&self,
_child_index: usize,
) -> Option<MotionAnimation>
fn motion_animation_for_child( &self, _child_index: usize, ) -> Option<MotionAnimation>
Source§fn motion_bindings(&self) -> Option<MotionBindings>
fn motion_bindings(&self) -> Option<MotionBindings>
Source§fn motion_stable_id(&self) -> Option<&str>
fn motion_stable_id(&self) -> Option<&str>
Source§fn motion_should_replay(&self) -> bool
fn motion_should_replay(&self) -> bool
Source§fn motion_is_suspended(&self) -> bool
fn motion_is_suspended(&self) -> bool
Source§fn motion_is_exiting(&self) -> bool
fn motion_is_exiting(&self) -> bool
Use query_motion(key).exit() to explicitly trigger motion exit
Source§fn set_auto_id(&mut self, _id: String) -> bool
fn set_auto_id(&mut self, _id: String) -> bool
Source§fn children_builders_mut(&mut self) -> &mut [Box<dyn ElementBuilder>]
fn children_builders_mut(&mut self) -> &mut [Box<dyn ElementBuilder>]
Source§fn element_classes(&self) -> &[String]
fn element_classes(&self) -> &[String]
Source§fn bound_scroll_ref(&self) -> Option<&ScrollRef>
fn bound_scroll_ref(&self) -> Option<&ScrollRef>
Source§fn motion_on_ready_callback(
&self,
) -> Option<Arc<dyn Fn(ElementBounds) + Send + Sync>>
fn motion_on_ready_callback( &self, ) -> Option<Arc<dyn Fn(ElementBounds) + Send + Sync>>
Source§fn layout_animation_config(&self) -> Option<LayoutAnimationConfig>
fn layout_animation_config(&self) -> Option<LayoutAnimationConfig>
Source§fn visual_animation_config(&self) -> Option<VisualAnimationConfig>
fn visual_animation_config(&self) -> Option<VisualAnimationConfig>
Auto Trait Implementations§
impl !Freeze for TextInput
impl !RefUnwindSafe for TextInput
impl !Send for TextInput
impl !Sync for TextInput
impl Unpin for TextInput
impl UnsafeUnpin for TextInput
impl !UnwindSafe for TextInput
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.