pub struct AppLayout<Node, Message>where
Message: Clone,{
pub body: Node,
pub header: Option<Node>,
pub side_bar: Option<Node>,
pub footer: Option<Node>,
pub header_menu: Option<Node>,
pub context_menu: Option<Node>,
pub dialog: Option<Dialog<Node, Message>>,
pub bottom_sheet: Option<BottomSheet<Node, Message>>,
pub toasts: Vec<Toast<Message>>,
pub direction: LayoutDirection,
pub on_close_menus: Option<Message>,
pub on_close_modals: Option<Message>,
}Expand description
The complete declarative description of what should be on screen.
Type parameters:
Node— the element type your engine consumes. With thesnoraengine, this isiced::Element<'a, Message>.Message— your application’s top-level message type.
Fields are intentionally pub so that direct struct literal syntax is
available for advanced callers. The new + chainable setters are the
canonical path; direct construction is a power-user escape hatch.
Fields§
§body: NodeThe main content area. Required.
header: Option<Node>§side_bar: Option<Node>Optional header-attached dropdown (e.g. File menu’s item list).
When Some, the engine installs a transparent backdrop that
dispatches Self::on_close_menus on any outside click.
Optional floating context menu (right-click menu). Same backdrop
behavior as header_menu.
dialog: Option<Dialog<Node, Message>>§bottom_sheet: Option<BottomSheet<Node, Message>>§toasts: Vec<Toast<Message>>§direction: LayoutDirectionDispatched when the user clicks outside an open menu (header or
context). If None, menus still render but the click-outside-to-
close backdrop is not installed — the application must then
provide explicit close buttons inside its menu content.
on_close_modals: Option<Message>Dispatched when the user clicks the dim backdrop of a dialog or
bottom sheet. Semantics mirror Self::on_close_menus.
Implementations§
Source§impl<Node, Message> AppLayout<Node, Message>where
Message: Clone,
impl<Node, Message> AppLayout<Node, Message>where
Message: Clone,
Sourcepub fn new(body: Node) -> Self
pub fn new(body: Node) -> Self
Start a layout with only a body. All other slots default to their
empty / None states.