pub enum Control {
Show 13 variants
Heading {
text: String,
},
Text {
text: String,
tone: Tone,
},
Input {
label: String,
value: String,
placeholder: Option<String>,
},
Actions {
actions: Vec<Action>,
},
Checkbox {
label: String,
value: bool,
},
Download {
exporter: String,
formats: Vec<Choice>,
},
Number(Number),
Select {
label: String,
value: String,
options: Vec<Choice>,
searchable: bool,
},
File {
label: String,
value: String,
files: Vec<FileEntry>,
upload: Vec<String>,
},
Color {
label: String,
value: String,
},
Reference(Reference),
List {
items: Vec<ListItem>,
empty: String,
},
Table(Table),
}Expand description
A dialog primitive.
Variants§
Heading
Text
Input
Text typed — a name, a title — sent back as super::Value::Text.
Actions
Things to do or choose, as buttons: pressing one sends its value as
super::Value::Choice. Grouped ones are shown under their group.
Checkbox
Download
Files the step can be saved as, one button per format: pressing
one asks the editor’s exporter exporter for the file in that
format (the choice’s value), written as the step now is — a
drawing — and saves it. It sets nothing.
Number(Number)
Select
One of options, by value — found by typing, if searchable.
File
A file the program reads or places, by its path relative to the
program, chosen in an explorer of files — every file of the
workspace but the program’s own, those the field does not take
among them, so the folders read as they are — and sent back as
super::Value::Choice. A file of the kinds upload (extensions,
without the dot; none, for a field taking only files there are) may
be added from elsewhere: the front end stores it next to the
program and sends its path.
Color
A colour, #rrggbb, sent back as super::Value::Text.
Reference(Reference)
List
Table(Table)
A table edited in place, every edit of it sent back as one
super::Value::Table.