1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
//! TreeView::highlight_style method. use ratatui::style::Style; use crate::primitives::tree_view::widget::TreeView; impl<'a, T> TreeView<'a, T> { /// Sets the highlight style for selected rows (full-width background). /// /// # Arguments /// /// * `style` - The style to apply to selected rows. /// /// # Returns /// /// Self for method chaining. /// /// # Example /// /// ```rust /// use ratatui::style::{Color, Style}; /// use ratatui_toolkit::tree_view::{TreeNode, TreeView}; /// /// let nodes = vec![TreeNode::new("Item")]; /// let tree = TreeView::new(nodes) /// .highlight_style(Style::default().bg(Color::Blue)); /// ``` pub fn highlight_style(mut self, style: Style) -> Self { self.highlight_style = Some(style); self } }