module treesource
The element tree: each element's widget, its children, its layout and its canvas node.
type Nodesource
exp type Node = struct
What laying out reads comes first, then the rest by width, which keeps a node at 136 bytes and layout as fast as measured.
Fields
exp widget: Option<*var Widget> = ::Noneexp children: Vector<u32> = Vector<u32>::empty()exp size: Extentexp position: Point = ORIGINin its parent's coordinates
exp shown_at: Point = ORIGINwhere painting shows it, its edges snapped to device pixels (painting.alloy), and how far its top left lies past the pixel it was snapped to, in device pixels (none until shown)
exp parent: Option<u32> = ::Noneexp generation: u32 = 0exp alive: bool = trueexp transparent: bool = falselaid out as part of its parent (show and each)
a hidden view's (switch, screens): with all under it, not laid out, drawn, hit, focused nor described
exp hovered: bool = falseexp moving: bool = falsegiven a transition (transitions.alloy), which plays as it goes
exp busy: bool = falseshowing a resource still loading (network.alloy), for screen readers
exp direction: LayoutDirection = LayoutDirection::LeftToRightwhich way it reads as last laid out, and the way
directedgave it (languages.alloy)exp draw: Option<NodeId> = ::Noneexp overlay: Option<NodeId> = ::Noneover the children of a clipping element
fn new_nodesource
exp fn new_node(self ui: &var Ui, widget: *var Widget, transparent: bool) -> u32
A new node for the widget, adopting the elements it holds.
fn elementsource
exp fn element(self ui: &Ui, index: u32) -> Element
fn adoptsource
exp fn adopt(self ui: &var Ui, parent: u32, child: Element)
Makes the element the node's last child.
fn mark_layoutsource
exp fn mark_layout(self ui: &var Ui, index: u32)
Lays the node out again, and the ancestors whose size may change with it.
fn mark_paintsource
exp fn mark_paint(self ui: &var Ui, index: u32)
fn applysource
exp fn apply(self ui: &var Ui, index: u32, change: Change)
Lays out or paints the node again as the change says.
fn node_sizingsource
exp fn node_sizing(self ui: &Ui, index: u32) -> Sizing
fn invalidate_allsource
exp fn invalidate_all(self ui: &var Ui)
Lays out and paints every element again, as for a new theme.
fn fontssource
exp fn fonts(self ui: &var Ui) -> &var text::Fonts
The fonts text is laid out with: the canvas's, or the Ui's own with
none (a headless Ui's, or one's before its window's first frame),
which hold the bundled faces alone, so that layout there is the same
on every machine and asks the system for nothing; each given what
install_fonts installs.