Skip to main content

group

Function group 

Source
pub fn group<'a>(
    ui: &mut Ui,
    fields: &'a [Field<'a>],
    show_extended: bool,
    style: &FieldStyle,
    draw: impl FnMut(&mut Ui, &'a Field<'a>),
)
Expand description

A set of fields, laid down a column.

show_extended is the disclosure, and it is a parameter rather than state held here because the disclosure belongs to the form and not to any field: Field::extended marks which fields are behind one, and the app owns whether it is open. That is the same division makeover-webview draws when it marks the group data-extended and emits no control to toggle it.

draw is called once per field that should be visible, in order. Taking a callback rather than a slice of Fillings is what keeps the app’s own values borrowed one at a time: a form’s fields usually live in different structs, and a parallel array would have to be built each frame and kept in step with the description by hand.