pub enum Node {
Show 17 variants
Stack {
style: StackStyle,
children: Nodes,
scrolls: bool,
},
Label {
text: Rc<Dynamic>,
style: LabelStyle,
},
Button {
title: Rc<Dynamic>,
style: ButtonStyle,
icon: Icon,
selected: Option<Rc<Dynamic>>,
action: Block,
},
TextField {
value: Rc<Binding>,
placeholder: String,
lines: u32,
action: Option<Block>,
},
Checkbox {
checked: Rc<Binding>,
title: Option<Rc<Dynamic>>,
style: ToggleStyle,
},
Slider {
value: Rc<Binding>,
min: i64,
max: i64,
},
Picker {
selection: Rc<Binding>,
options: Rc<Dynamic>,
deps: StateSet,
},
NavItem(NavItem),
Image {
path: Rc<Dynamic>,
size: ImageSize,
},
Progress {
value: Option<Rc<Dynamic>>,
},
Spacer,
Divider,
ContextMenu {
entries: Vec<MenuEntry<Block>>,
},
DropTarget {
dropped: Rc<Binding>,
action: Option<Block>,
},
If {
branches: Vec<(Rc<Expr>, Nodes)>,
otherwise: Nodes,
deps: StateSet,
},
For {
head: Rc<Loop>,
body: Nodes,
deps: StateSet,
},
View {
view: ViewId,
args: Rc<[Expr]>,
deps: StateSet,
},
}Expand description
UI parts are shared, so whatever runs the program can keep them for as long as it shows them.
Variants§
Stack
A column or row, or, when it scrolls, a scroll area.
Label
Button
Shown as selected while selected holds, when it has one.
TextField
Edits text on one line, or wraps it over lines lines and scrolls it. A one-line
field with an action runs it on Return.
Checkbox
A checkbox, or a switch, by its style.
Slider
Picks a whole number from min to max.
Picker
Picks one of options into selection.
Fields
Image
The image in the file at path, shown at size.
Progress
A progress bar showing value percent done, or that work is under way when it has
no value.
Spacer
Divider
ContextMenu
A menu shown when the stack it is in is right-clicked.
DropTarget
Takes files and links dropped on the stack it is in: writes their paths and
addresses to dropped, then runs action, if it has one.
If
Rebuilt when deps change; the first branch whose condition holds is shown.
For
Rebuilt when deps change; body is shown once per element.
View
Rebuilt when deps change; the arguments fill the view’s parameters.