pub enum Region<'a> {
Band,
Sidebar,
Pane,
Split,
TabGroup,
Modal,
Bespoke {
name: &'a str,
},
}Expand description
A named part of a screen.
The thing makeover-geometry deliberately does not name: it names the space
between things by relationship, and nothing named the things. Six named
members, taken from what the two webview apps actually use, plus
Region::Bespoke for the parts no description should reach. Both apps’
layout.css currently names exactly two things, .raised and .well, so
this layer is absent rather than divergent, which makes it the cheapest of
the schemas to add and the easiest to over-build.
Variants§
Band
A full-width strip with a title slot and an actions cluster, either of
which may be empty. goingson’s .page-header, Balanced Breakfast’s
.header and .detail-header are all this, differing only in which
slots they fill.
Sidebar
A persistent column beside the content, holding navigation.
Pane
A region of content with its own scroll.
Split
Two panes side by side, where the left chooses what the right shows.
TabGroup
A set of panes, one visible at a time, with a Selector::Tabs above.
Modal
Content over a scrim, taking input until dismissed.
Bespoke
A region this crate names the place of and nothing else. The app owns what goes in it.
The escape hatch, and the thing that keeps the description honest about its own limits. A day-plan timeline, a kanban board, a calendar and the paint interaction over the timeline are not describable here and are not going to become describable: a description expressive enough to produce a timeline is a widget library wearing a description’s name.
But a screen containing one still has to be a screen. Without this member the description covers only the boring screens, and the four that make goingson worth using would need a second, undescribed path beside the router. Two paths is how the vocabulary starts drifting from the app again, which is the exact failure this crate exists to end.
So the description says “a thing called day-plan goes here” and stops.
The name is opaque: this crate never interprets it, and no renderer is
expected to know what it means beyond handing the space over.
Implementations§
Source§impl Region<'_>
impl Region<'_>
Sourcepub const fn described(self) -> bool
pub const fn described(self) -> bool
Whether this crate can say anything about the region’s contents.
A renderer walks the description and hands every region it understands
to the right drawing code. This is how it tells the two apart, and the
reason it is a method rather than a matches! at each renderer: there
is exactly one opaque member and there should stay exactly one.