pub struct NavLayout {
pub sizes: Rc<RefCell<HashMap<RNode, Size>>>,
pub presentation: Rc<Cell<NavPresentation>>,
pub sidebar: Rc<Cell<Option<RNode>>>,
pub list: Rc<Cell<Option<RNode>>>,
pub list_width: f64,
pub list_visible: Rc<Cell<bool>>,
}Expand description
Navigation host (docs/navigation.md): page frames are native-owned (splitter panes,
nav-controller views), so set_frame on pages is a toolkit no-op; Day lays each page’s
content within the size the toolkit last reported via Event::FrameChanged, falling
back to a sidebar/detail split (or the full host) of the host bounds.
Fields§
§sizes: Rc<RefCell<HashMap<RNode, Size>>>§presentation: Rc<Cell<NavPresentation>>The presentation as last resolved. Shared with the piece rather than copied, so a
re-present (NavPatch::Presentation) changes the fallback split without rebuilding the
layout object the host was realized with.
The host’s sidebar page, once it has one. Identity, not position: after a re-present the pages keep their roles but a backend may have re-homed them in a different order.
list: Rc<Cell<Option<RNode>>>The host’s content-list page (Pane::List), once it has one; shared like sidebar.
list_width: f64The content-list pane’s preferred width (NavProps::list_width), for the fallback split.
list_visible: Rc<Cell<bool>>Whether the pane is showing (NavPatch::ListVisible), shared with the piece so a
collapsed pane stops narrowing the detail’s fallback immediately, rather than one
FrameChanged report later.
Implementations§
Trait Implementations§
fn measure( &self, _cx: &mut dyn LayoutOps, _children: &[RNode], p: Proposal, ) -> Size
fn place(&self, cx: &mut dyn LayoutOps, children: &[RNode], bounds: Rect)
Source§fn baseline(
&self,
_cx: &mut dyn LayoutOps,
_children: &[RNode],
_size: Size,
) -> Option<f64>
fn baseline( &self, _cx: &mut dyn LayoutOps, _children: &[RNode], _size: Size, ) -> Option<f64>
size (docs/baseline.md). None (the default) means the node has no baseline to
offer, so a baseline-aligned parent falls back to box alignment for it. Read moreAuto Trait Implementations§
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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