pub struct SettingsList<Msg> { /* private fields */ }Expand description
Settings, one per row: the label (and a faint description) on the left, its control anchored on the right.
Rows are bare until touched. The row under the pointer raises its surface with a soft
pillar; the keyboard’s row, while the list has focus, raises it further with a breathing
pillar. A focused list raises only one row: moving the pointer onto a row makes it the
keyboard’s row. Only the label slides one cell right; the pillar and the control never move.
The label column keeps one spare cell for that and cuts long labels with ….
The list takes focus as one control. ↑/↓ (and Home/End) move between enabled rows; every
other key goes to the selected row’s control, so Enter or Space toggles a switch or opens a
select and ←/→ change a segmented control. Keys the control does not use activate the row
when it has SettingRow::on_activate. The pointer works on controls directly; clicking a
label selects its row. The application owns every value; the keyboard’s row lives in the
runtime.
Style keys: setting-row (bg, pillar) with hover, selected, focus, disabled;
setting-label (fg, bold) and setting-description (fg) with the same states;
settings-heading (fg, bold).
Implementations§
Source§impl<Msg: Clone + 'static> SettingsList<Msg>
impl<Msg: Clone + 'static> SettingsList<Msg>
Trait Implementations§
Source§impl<Msg: Clone + 'static> Widget<Msg> for SettingsList<Msg>
impl<Msg: Clone + 'static> Widget<Msg> for SettingsList<Msg>
Source§fn measure(&self, cx: &mut MeasureCx<'_>, available: Size) -> Size
fn measure(&self, cx: &mut MeasureCx<'_>, available: Size) -> Size
available.Source§fn event(&self, cx: &mut EventCx<'_, Msg>, event: &Event) -> bool
fn event(&self, cx: &mut EventCx<'_, Msg>, event: &Event) -> bool
true when the event was used; unused key and scroll events
bubble to the parent widget.Source§fn children_mut(&mut self) -> &mut [Node<Msg>]
fn children_mut(&mut self) -> &mut [Node<Msg>]
Source§fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
PaintCx::request_overlay. anchor is the area the widget was painted in.Auto Trait Implementations§
impl<Msg> !RefUnwindSafe for SettingsList<Msg>
impl<Msg> !Send for SettingsList<Msg>
impl<Msg> !Sync for SettingsList<Msg>
impl<Msg> !UnwindSafe for SettingsList<Msg>
impl<Msg> Freeze for SettingsList<Msg>
impl<Msg> Unpin for SettingsList<Msg>
impl<Msg> UnsafeUnpin for SettingsList<Msg>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more