Skip to main content

setting_row

Function setting_row 

Source
pub fn setting_row<'a, Message: 'a>(
    index: usize,
    label: impl IntoFragment<'a>,
    hint: Option<Element<'a, Message>>,
    control: impl Into<Element<'a, Message>>,
    scale: FontScale,
) -> Element<'a, Message>
Expand description

One setting: its label on the left (with an optional hint under it), its control on the right, on a card that is striped or clear by index.

The label and control sit at the row’s two ends rather than in a fixed 2:3 split. The split put a wide gap between “Description” and its field, so the two read as unrelated; at the ends, the row itself is what joins them, which is the job the stripe is doing anyway.

At least density::setting_row_height tall, so a page of one-line rows keeps a steady rhythm, and taller when a hint needs the room — never clipped to fit.