pub enum Arrangement {
ListDetail {
tabbed: bool,
share: Share,
},
SidebarContent {
share: Share,
},
Single,
}Expand description
How a screen is laid out.
Three, and no one of them is a variant of another. goingson is list-detail, Balanced Breakfast is sidebar plus content, and MNW’s embeds are one region filling the document. The tab group is a modifier rather than a member, because goingson uses it inside the same content region rather than instead of one.
This exists at all because the router has to be able to express a screen rather than only a control. Discovering the arrangement layer missing after the renderers exist is a redesign; naming two now is a morning.
§Why the share rides here
e0fd485e. A share is per-arrangement: how much a sidebar takes and how
much a list side takes are different questions, and this enum is the only
thing that knows which one is being asked. Geometry would have had to invent
a channel to be told.
list_detail and
sidebar_content build these with the default
shares, so a screen that has no opinion does not have to have one.
Variants§
ListDetail
A list that chooses what the detail beside it shows.
Fields
tabbed: boolWhether the detail side is a Region::TabGroup.
How much of the width the list side takes.
SidebarContent
Navigation down the side, content filling the rest.
Fields
How much of the width the sidebar takes.
Single
One region, filling the document.
52699de6. The other two are both about dividing a width between two
regions, so a screen that is one region had to borrow one of them and
then undo it: MNW’s five embeds said list_detail(title, false) and the
host spent a display: block cancelling the grid that produced. A host
writing CSS to contradict the description rather than to add to it is
the thing this member ends.
Carries no Share, because there is no division to describe. That is
why share answers None here.
Implementations§
Source§impl Arrangement
impl Arrangement
Sourcepub const fn list_detail(tabbed: bool) -> Self
pub const fn list_detail(tabbed: bool) -> Self
A list and a detail beside it, at the default share.
A sidebar and content beside it, at the default share.
How much of the width the first region takes, when two regions divide it.
None for Single: one region takes the width, and a
renderer that asked how to divide it was asking the wrong question. It
answers Option rather than a full-width Share so that a host cannot
quietly draw a one-region screen as a grid with an empty second column.
The same arrangement, at this share.
Single is returned unchanged: it has no division to
set, so a share named for it is a statement about nothing rather than an
error worth refusing a screen over.
Trait Implementations§
Source§impl Clone for Arrangement
impl Clone for Arrangement
Source§fn clone(&self) -> Arrangement
fn clone(&self) -> Arrangement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more