pub struct Node<M>(/* private fields */);Expand description
A piece of UI. Build it with the functions in this module.
Implementations§
Source§impl<M> Node<M>
impl<M> Node<M>
Sourcepub fn tone(self, tone: Tone) -> Self
pub fn tone(self, tone: Tone) -> Self
Sets the tone of this text, or of every text inside this node that has none yet.
Sourcepub fn on_hover(self, index: usize) -> Self
pub fn on_hover(self, index: usize) -> Self
For an alternate: shows the option at index while the pointer is over the item,
whatever current is. Other nodes have nothing to show on hover and ignore it.
Sourcepub fn on_secondary(self, message: M) -> Self
pub fn on_secondary(self, message: M) -> Self
Sourcepub fn prominent(self) -> Self
pub fn prominent(self) -> Self
For a button: the main action of its page, filled so it stands out. Other nodes ignore
it.
Sourcepub fn on_press(self, message: M) -> Self
pub fn on_press(self, message: M) -> Self
For a list_item: sent on a click on it. Other nodes ignore it.
Sourcepub fn subtitle(self, text: impl Into<String>) -> Self
pub fn subtitle(self, text: impl Into<String>) -> Self
For a list_item: a second, dimmer line under the title. Other nodes ignore it.
Sourcepub fn leading(self, node: Node<M>) -> Self
pub fn leading(self, node: Node<M>) -> Self
For a list_item: an icon before the title. Other nodes ignore it.
Sourcepub fn trailing(self, node: Node<M>) -> Self
pub fn trailing(self, node: Node<M>) -> Self
For a list_item, section, header, text_input or text_area: a node at the
far end, like a lock or an info button. Other nodes ignore it.
Sourcepub fn selected(self, yes: bool) -> Self
pub fn selected(self, yes: bool) -> Self
For a list_item: marks it as the one in use. Other nodes ignore it.
Sourcepub fn on_back(self, message: M) -> Self
pub fn on_back(self, message: M) -> Self
For a header: shows a back button that sends message. Other nodes ignore it.
Sourcepub fn step(self, by: f32) -> Self
pub fn step(self, by: f32) -> Self
For a slider: the step its value snaps to (1 by default). Other nodes ignore it.
Sourcepub fn on_release(self, message: M) -> Self
pub fn on_release(self, message: M) -> Self
For a slider: sent when it’s let go. Other nodes ignore it.
Sourcepub fn on_submit(self, message: M) -> Self
pub fn on_submit(self, message: M) -> Self
For a text_input or text_area: sent on Enter. Other nodes ignore it.
Sourcepub fn secret(self, yes: bool) -> Self
pub fn secret(self, yes: bool) -> Self
For a text_input: hides what’s typed, like a password. Other nodes ignore it.
Sourcepub fn large(self) -> Self
pub fn large(self) -> Self
For a cover: drawn big, as the main picture of a popover, not as an icon. Other nodes
ignore it.
Sourcepub fn bottom(self) -> Self
pub fn bottom(self) -> Self
For a scroll: keeps its end in view as content arrives there, unless you’ve scrolled
up to read. Other nodes ignore it.