Available on crate feature
toggle-group only.Expand description
A row of toggles where one, or several, can be on.
State owns the items and the selection. In Mode::Single pressing
an item turns the others off, like a segmented control; in
Mode::Multiple each item switches on and off by itself, like the
formatting buttons of a text editor. Disabled items are skipped.
Keyboard shortcuts resolve through a Keymap of Actions; see
default_keymap and crate::keys.
Structs§
- Item
- One item in a
State. - State
- The items and which of them are on.
- Toggle
Group - A toggle group builder. Convert it into an
Elementto render.
Enums§
- Action
- What a toggle group keyboard shortcut does.
- Event
- Changes to the selection.
- Mode
- Whether one or several items can be on.
- Position
- Where an item sits in an outlined group, which decides its corners.
- Variant
- How the group is drawn.
Functions§
- default_
keymap - The default toggle group shortcuts:
- divider_
style - The line between segments: the group’s border colour.
- group_
style - The container around the items: nothing for separate toggles, one border for an outlined group.
- item
- Creates an enabled item.
- item_
style - The style of one item: a toggle, with square inner corners and no gap when the group is outlined.
- toggle_
group - Renders the items of
state. Withouton_eventevery item renders disabled.