pub struct TreeNode<'a, T, L = &'static str> { /* private fields */ }
Expand description
Builder for a tree node widget
Implementations§
source§impl<'a, T: AsRef<str>, L: AsRef<str>> TreeNode<'a, T, L>
impl<'a, T: AsRef<str>, L: AsRef<str>> TreeNode<'a, T, L>
sourcepub fn label<I: Into<TreeNodeId<L2>>, L2: AsRef<str>>(
self,
label: L2
) -> TreeNode<'a, T, L2>
pub fn label<I: Into<TreeNodeId<L2>>, L2: AsRef<str>>( self, label: L2 ) -> TreeNode<'a, T, L2>
Sets the tree node label
sourcepub fn opened(self, opened: bool, cond: Condition) -> Self
pub fn opened(self, opened: bool, cond: Condition) -> Self
Sets the opened state of the tree node, which is applied based on the given condition value
sourcepub fn flags(self, flags: TreeNodeFlags) -> Self
pub fn flags(self, flags: TreeNodeFlags) -> Self
Replaces all current settings with the given flags.
sourcepub fn selected(self, value: bool) -> Self
pub fn selected(self, value: bool) -> Self
Enables/disables drawing the tree node in selected state.
Disabled by default.
sourcepub fn framed(self, value: bool) -> Self
pub fn framed(self, value: bool) -> Self
Enables/disables full-colored frame.
Disabled by default.
sourcepub fn allow_item_overlap(self, value: bool) -> Self
pub fn allow_item_overlap(self, value: bool) -> Self
Enables/disables allowing the tree node to overlap subsequent widgets.
Disabled by default.
sourcepub fn tree_push_on_open(self, value: bool) -> Self
pub fn tree_push_on_open(self, value: bool) -> Self
Enables/disables automatic tree push when the tree node is open (= adds extra indentation and pushes to the ID stack).
Enabled by default.
sourcepub fn auto_open_on_log(self, value: bool) -> Self
pub fn auto_open_on_log(self, value: bool) -> Self
Enables/disables automatic opening of the tree node when logging is active.
By default, logging will automatically open all tree nodes.
Enabled by default.
sourcepub fn default_open(self, value: bool) -> Self
pub fn default_open(self, value: bool) -> Self
Sets the default open state for the tree node.
Tree nodes are closed by default.
sourcepub fn open_on_double_click(self, value: bool) -> Self
pub fn open_on_double_click(self, value: bool) -> Self
Only open when the tree node is double-clicked.
Disabled by default.
sourcepub fn open_on_arrow(self, value: bool) -> Self
pub fn open_on_arrow(self, value: bool) -> Self
Only open when clicking the arrow part of the tree node.
Disabled by default.
sourcepub fn leaf(self, value: bool) -> Self
pub fn leaf(self, value: bool) -> Self
Enable/disables leaf mode (no collapsing, no arrow).
Disabled by default.
sourcepub fn bullet(self, value: bool) -> Self
pub fn bullet(self, value: bool) -> Self
Display a bullet instead of arrow.
Disabled by default.
sourcepub fn frame_padding(self, value: bool) -> Self
pub fn frame_padding(self, value: bool) -> Self
Use frame_padding
to vertically align text baseline to regular widget height.
Disabled by default.
Left direction may move to this tree node from any of its child.
Disabled by default.
sourcepub fn push(self) -> Option<TreeNodeToken<'a>>
pub fn push(self) -> Option<TreeNodeToken<'a>>
Pushes a tree node and starts appending to it.
Returns Some(TreeNodeToken)
if the tree node is open. After content has been
rendered, the token can be popped by calling .pop()
.
Returns None
if the tree node is not open and no content should be rendered.