[−][src]Trait iced_native::widget::text_input::Renderer
The renderer of a TextInput
.
Your renderer will need to implement this trait before being
able to use a TextInput
in your user interface.
Associated Types
Loading content...Required methods
fn measure_value(&self, value: &str, size: u16, font: Self::Font) -> f32
Returns the width of the value of the TextInput
.
fn offset(
&self,
text_bounds: Rectangle,
font: Self::Font,
size: u16,
value: &Value,
state: &State
) -> f32
&self,
text_bounds: Rectangle,
font: Self::Font,
size: u16,
value: &Value,
state: &State
) -> f32
Returns the current horizontal offset of the value of the
TextInput
.
This is the amount of horizontal scrolling applied when the Value
does not fit the TextInput
.
fn draw(
&mut self,
bounds: Rectangle,
text_bounds: Rectangle,
cursor_position: Point,
font: Self::Font,
size: u16,
placeholder: &str,
value: &Value,
state: &State,
style: &Self::Style
) -> Self::Output
&mut self,
bounds: Rectangle,
text_bounds: Rectangle,
cursor_position: Point,
font: Self::Font,
size: u16,
placeholder: &str,
value: &Value,
state: &State,
style: &Self::Style
) -> Self::Output
Provided methods
fn find_cursor_position(
&self,
text_bounds: Rectangle,
font: Self::Font,
size: Option<u16>,
value: &Value,
state: &State,
x: f32
) -> usize
&self,
text_bounds: Rectangle,
font: Self::Font,
size: Option<u16>,
value: &Value,
state: &State,
x: f32
) -> usize
Computes the position of the text cursor at the given X coordinate of
a TextInput
.
Implementors
impl Renderer for Null
[src]
type Style = ()
fn measure_value(&self, _value: &str, _size: u16, _font: Font) -> f32
[src]
fn offset(
&self,
_text_bounds: Rectangle,
_font: Font,
_size: u16,
_value: &Value,
_state: &State
) -> f32
[src]
&self,
_text_bounds: Rectangle,
_font: Font,
_size: u16,
_value: &Value,
_state: &State
) -> f32
fn draw(
&mut self,
_bounds: Rectangle,
_text_bounds: Rectangle,
_cursor_position: Point,
_font: Font,
_size: u16,
_placeholder: &str,
_value: &Value,
_state: &State,
_style: &Self::Style
) -> Self::Output
[src]
&mut self,
_bounds: Rectangle,
_text_bounds: Rectangle,
_cursor_position: Point,
_font: Font,
_size: u16,
_placeholder: &str,
_value: &Value,
_state: &State,
_style: &Self::Style
) -> Self::Output