pub struct AreaBuilder<'a> { /* private fields */ }Expand description
A multiline text area (a <textarea>) whose box the app paints itself: the kit
registers it at rect, wraps the text to its width, paints text, placeholder,
selection, IME composition and a blinking caret line by line, and feeds per-line
caret geometry to the text store, so clicks, drags, double / triple clicks,
ArrowUp / ArrowDown and Home / End work by laid lines. Start with area.
Implementations§
Source§impl<'a> AreaBuilder<'a>
impl<'a> AreaBuilder<'a>
Sourcepub fn config(self, c: TextFieldConfig) -> Self
pub fn config(self, c: TextFieldConfig) -> Self
Editing behaviour (max length, filter, read-only); multiline is kept on.
Sourcepub fn placeholder(self, p: &'a str) -> Self
pub fn placeholder(self, p: &'a str) -> Self
Grey hint while empty.
Sourcepub fn clip_to(self, r: Rect) -> Self
pub fn clip_to(self, r: Rect) -> Self
Clip paint and hits to r too (the scroll viewport the area sits in).
Sourcepub fn line_height(self, h: f64) -> Self
pub fn line_height(self, h: f64) -> Self
Line height (default 1.45 × px).
Sourcepub fn colors(self, text: &'a str, placeholder: &'a str) -> Self
pub fn colors(self, text: &'a str, placeholder: &'a str) -> Self
Text and placeholder colours (CSS); the theme’s when unset.
Sourcepub fn caret_color(self, c: &'a str) -> Self
pub fn caret_color(self, c: &'a str) -> Self
Caret colour (the text colour when unset).
Sourcepub fn set(self, text: Option<&'a str>) -> Self
pub fn set(self, text: Option<&'a str>) -> Self
Replace the text this frame (Some("") clears it); the caret goes to the end.
Sourcepub fn parent(self, p: impl Into<WidgetId>) -> Self
pub fn parent(self, p: impl Into<WidgetId>) -> Self
Nest the area under a container (a dialog scrim) for focus scoping.
Sourcepub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> AreaResponse
pub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> AreaResponse
Register, draw, and feed the store.