pub struct TextInput {Show 21 fields
pub text: String,
pub font: Option<Font>,
pub font_size: f32,
pub pos_x: usize,
pub pos_y: usize,
pub width: usize,
pub height: usize,
pub bg_col_idle: Color,
pub border_col_idle: Color,
pub text_col_idle: Color,
pub border_size_idle: usize,
pub bg_col_editing: Color,
pub border_col_editing: Color,
pub text_col_editing: Color,
pub border_size_editing: usize,
pub cursor_col: Color,
pub cursor_width: usize,
pub radius: usize,
pub state: TextInputState,
pub cursor_pos: usize,
pub scroll_offset: f32,
/* private fields */
}Fields§
§text: String§font: Option<Font>§font_size: f32§pos_x: usize§pos_y: usize§width: usize§height: usize§bg_col_idle: Color§border_col_idle: Color§text_col_idle: Color§border_size_idle: usize§bg_col_editing: Color§border_col_editing: Color§text_col_editing: Color§border_size_editing: usize§cursor_col: Color§cursor_width: usize§radius: usizeCorner radius for rounded edges
state: TextInputState§cursor_pos: usize§scroll_offset: f32Implementations§
Source§impl TextInput
impl TextInput
pub fn font(self, font: Font, size: f32) -> Self
pub fn position(self, x: usize, y: usize) -> Self
pub fn size(self, width: usize, height: usize) -> Self
pub fn placeholder(self, text: &str) -> Self
pub fn background(self, color: Color) -> Self
pub fn idle_bg(self, color: Color) -> Self
pub fn editing_bg(self, color: Color) -> Self
pub fn border_color(self, color: Color) -> Self
pub fn idle_border_col(self, color: Color) -> Self
pub fn editing_border_col(self, color: Color) -> Self
pub fn border(self, size: usize) -> Self
pub fn text_color(self, color: Color) -> Self
pub fn idle_text_col(self, color: Color) -> Self
pub fn editing_text_col(self, color: Color) -> Self
pub fn cursor_color(self, color: Color) -> Self
Sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Returns whether the input is currently being edited
Trait Implementations§
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
Mutably borrows from an owned value. Read more