pub enum Selector {
Segmented,
Toggle,
Tabs,
}Expand description
A control that picks between things.
Three, because three distinct behaviours are in play and collapsing any two loses something. A segmented control picks a value; a tab picks a pane; a toggle picks nothing and simply holds itself on or off.
Variants§
Segmented
Exactly one of N, and the options abut.
Toggle
Independent on or off, on its own.
Tabs
Navigation between panes. The folder semantic.
Implementations§
Source§impl Selector
impl Selector
Sourcepub const fn chosen(self) -> Depth
pub const fn chosen(self) -> Depth
How the chosen option sits.
Held in for a segmented control and a toggle, which is the same shape pressing produces and the whole economy of the idiom: one appearance, two reasons to wear it. A tab is the exception, because the selected folder tab comes forward to join the pane it opens.
Sourcepub const fn unchosen(self) -> Depth
pub const fn unchosen(self) -> Depth
How the options that were not picked sit.
Added 0.3.0. Describing only Selector::chosen left the unchosen
option falling through to Depth::Flat, which says it is level with
the strip it sits in, and no renderer emitted anything for it. That is
wrong in both directions and goingson proved it: its unchosen tabs are
recessed by hand, and being recessed is why the chosen one reads as
coming forward. Against a flat strip, a raised chosen tab is a bevel
drawn on the strip’s own colour, which is a much weaker folder effect
than the contrast the idiom is named after.
Each member is the inverse of its chosen state, which is the whole content of “picked” once colour is deferred:
- Tabs recede, so the chosen one comes forward.
- A segment and a toggle stand up, so the chosen one is held in.