pub struct TreeView<V: NodeValue> { /* private fields */ }Expand description
§TreeView
Tree view component for tui-realm
Implementations§
Source§impl<V: NodeValue> TreeView<V>
impl<V: NodeValue> TreeView<V>
Sourcepub fn foreground(self, fg: Color) -> Self
pub fn foreground(self, fg: Color) -> Self
Set the main foreground color. This may get overwritten by individual text styles.
Sourcepub fn background(self, bg: Color) -> Self
pub fn background(self, bg: Color) -> Self
Set the main background color. This may get overwritten by individual text styles.
Sourcepub fn modifiers(self, m: TextModifiers) -> Self
pub fn modifiers(self, m: TextModifiers) -> Self
Set the main text modifiers. This may get overwritten by individual text styles.
Sourcepub fn style(self, style: Style) -> Self
pub fn style(self, style: Style) -> Self
Set the main style. This may get overwritten by individual text styles.
This option will overwrite any previous foreground, background and modifiers!
Sourcepub fn inactive(self, s: Style) -> Self
pub fn inactive(self, s: Style) -> Self
Set a custom style for the border when the component is unfocused.
Sourcepub fn highlight_str<S: Into<LineStatic>>(self, s: S) -> Self
pub fn highlight_str<S: Into<LineStatic>>(self, s: S) -> Self
Set the Symbol and Style for the indicator of the current line.
Sourcepub fn highlight_style(self, s: Style) -> Self
pub fn highlight_style(self, s: Style) -> Self
Set a custom highlight style that is patched on-top of the normal style.
By default the highlight style is just Style::new().add_modifier(Modifier::REVERSED).
Sourcepub fn highlight_style_inactive(self, s: Style) -> Self
pub fn highlight_style_inactive(self, s: Style) -> Self
Set a custom highlight style that is patched on-top of the highlight style when unfocused.
Sourcepub fn initial_node<S: Into<String>>(self, node: S) -> Self
pub fn initial_node<S: Into<String>>(self, node: S) -> Self
Set initial node for tree state.
NOTE: this must be specified after with_tree
Sourcepub fn preserve_state(self, preserve: bool) -> Self
pub fn preserve_state(self, preserve: bool) -> Self
Set whether to preserve state on tree change
Sourcepub fn indent_size(self, sz: u16) -> Self
pub fn indent_size(self, sz: u16) -> Self
Set indent size for widget for each level of depth
Sourcepub fn scroll_step(self, step: usize) -> Self
pub fn scroll_step(self, step: usize) -> Self
Set scroll step for scrolling command
Sourcepub fn set_tree(&mut self, tree: Tree<V>)
pub fn set_tree(&mut self, tree: Tree<V>)
Set new tree in component.
Current state is preserved if PRESERVE_STATE is set to AttrValue::Flag(true)
Sourcepub fn tree_state(&self) -> &TreeState
pub fn tree_state(&self) -> &TreeState
Get a reference to the current tree state
Trait Implementations§
Source§impl<V: NodeValue> Component for TreeView<V>
impl<V: NodeValue> Component for TreeView<V>
Source§fn view(&mut self, frame: &mut Frame<'_>, area: Rect)
fn view(&mut self, frame: &mut Frame<'_>, area: Rect)
Source§fn query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
fn query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
Auto Trait Implementations§
impl<V> Freeze for TreeView<V>where
V: Freeze,
impl<V> !RefUnwindSafe for TreeView<V>
impl<V> Send for TreeView<V>where
V: Send,
impl<V> Sync for TreeView<V>where
V: Sync,
impl<V> Unpin for TreeView<V>where
V: Unpin,
impl<V> UnsafeUnpin for TreeView<V>where
V: UnsafeUnpin,
impl<V> !UnwindSafe for TreeView<V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more