Skip to main content

value_editor

Function value_editor 

Source
pub fn value_editor(
    ui: &mut Ui,
    salt: Id,
    kind: &CellKind,
    value: Option<&Value>,
    size: Vec2,
) -> (Option<Value>, Rect)
Expand description

Draw the editor for ONE value of a CellKind and report the committed edit, if any. salt seeds the per-widget egui ids (an in-progress text buffer, a combo’s open state), so it must be stable for a given value and distinct between values; size is the space to fill.

Split out of [cell_editor] so a consumer that is NOT a table can use the same editors: the part-properties dialog edits the same BOM attribute records the BOM table’s cells do, and a Choice that could be cleared in one place but not the other, or a text field that committed per keystroke in one and on focus-loss in the other, would be one attribute with two behaviours. The kinds that only make sense inside a table row (Button, Actions, Badges, Toggle) stay in [cell_editor]; asking for one here draws the value read-only.