pub struct DomBuilder<'a> { /* private fields */ }Expand description
A DOM tree (uzor::ui::dom) inside a kit panel. Start with dom.
Implementations§
Source§impl<'a> DomBuilder<'a>
impl<'a> DomBuilder<'a>
Sourcepub fn viewport(self, r: Rect) -> Self
pub fn viewport(self, r: Rect) -> Self
The viewport fixed elements are placed against (the panel rect by default).
Sourcepub fn paint_slots(
self,
paint: &'a mut dyn FnMut(&mut dyn RenderContext, &SlotFrame<'_>),
) -> Self
pub fn paint_slots( self, paint: &'a mut dyn FnMut(&mut dyn RenderContext, &SlotFrame<'_>), ) -> Self
Paint the tree’s embed slots with paint in paint order: each slot’s content
is drawn right after its box, clipped to it and to its scroll containers, so a
popover, a fixed sheet or a toast declared later stays on top. A paint slot
(uzor::ui::dom::El::paint_slot) also gets the gestures it captured.
Sourcepub fn number(self, id: impl Into<String>, spec: NumberSpec) -> Self
pub fn number(self, id: impl Into<String>, spec: NumberSpec) -> Self
Make the text input id a number field (uzor::ui::domkit::number_input):
only what spec accepts can be typed, {id}:inc / {id}:dec, ArrowUp / ArrowDown
(with DomBuilder::key) and the wheel over the focused field step it, and
leaving it tidies the text (NumberSpec::normalized). Every change comes back in
DomResponse::edited; read the value with NumberSpec::parse.
Sourcepub fn key(self, k: Option<&'a KeyInput>) -> Self
pub fn key(self, k: Option<&'a KeyInput>) -> Self
This frame’s key press, if any (the app forwards keys it did not use): the arrow
keys step a focused number field (DomResponse::key_used).
Sourcepub fn dom_scroll(self) -> Self
pub fn dom_scroll(self) -> Self
Let elements with an id and overflow: auto | scroll be framework-owned
scroll containers (see dom). Off by default, so an app that already
scrolls those boxes itself is unchanged.
Sourcepub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> DomResponse
pub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> DomResponse
Paint the tree and register its hit targets and fields.