pub struct FieldBuilder<'a> { /* private fields */ }Expand description
A borderless text field inside the app’s own chrome. Start with field.
Implementations§
Source§impl<'a> FieldBuilder<'a>
impl<'a> FieldBuilder<'a>
Sourcepub fn config(self, c: TextFieldConfig) -> Self
pub fn config(self, c: TextFieldConfig) -> Self
Editing behaviour (text, search, password, multiline, max length).
Sourcepub fn placeholder(self, p: &'a str) -> Self
pub fn placeholder(self, p: &'a str) -> Self
Grey hint while empty.
Sourcepub fn text_rect(self, r: Rect) -> Self
pub fn text_rect(self, r: Rect) -> Self
Where the text runs, when it is inset inside the hit rect.
Sourcepub fn clip(self, on: bool) -> Self
pub fn clip(self, on: bool) -> Self
Clip the text to its rect and scroll it with the caret (on by default; false
lets it run past the rect).
Sourcepub fn clip_to(self, r: Rect) -> Self
pub fn clip_to(self, r: Rect) -> Self
Clip paint and hits to r as well: the scroll viewport (or other overflow: hidden box) the field sits in. A field scrolled out of r keeps its text but
is neither painted nor hit; one half out shows and hits only its visible part.
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 set(self, text: Option<&'a str>) -> Self
pub fn set(self, text: Option<&'a str>) -> Self
Replace the text this frame (Some("") clears it, undo included); 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 field under a container (a dialog scrim) for focus scoping.
Sourcepub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> FieldResponse
pub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> FieldResponse
Register, draw, and feed the store.