Skip to main content

field

Function field 

Source
pub fn field(
    ui: &mut Ui,
    field: &Field<'_>,
    filling: Filling<'_>,
    state: Option<State>,
    palette: &Palette,
    style: &FieldStyle,
) -> Option<Response>
Expand description

One field, as the column the app drops into its form.

The anatomy is makeover-webview’s, so the two renderers put a form together the same way: label, control, hint, error, top to bottom, with a checkbox labelling itself instead of taking a label above.

Returns None for a FieldKind::Hidden field, which is what FieldKind::visible means and is the honest answer here: a webview still emits an input for it because the form submits, and an immediate-mode renderer has no form and no submission, so a hidden field is a value the app already holds and there is nothing to draw or to respond to.

state is the description’s interaction axis. State::Disabled greys the field and stops it answering, through State::suppresses_interaction rather than through a second reading of what disabled means. State::Focus is deliberately not acted on: egui paints its own focus stroke and the description asks for one ring, not one per renderer that happens to have opinions.