pub struct TreeView { /* private fields */ }Expand description
Hierarchical tree view component
Displays nested items in a collapsible tree structure.
§Example
use armas_basic::{TreeView, TreeItem};
let items = vec![
TreeItem::folder("src", "/src"),
TreeItem::file("main.rs", "/src/main.rs"),
TreeItem::file("lib.rs", "/src/lib.rs"),
];
let mut tree = TreeView::new()
.items(items)
.root_path("/");
let response = tree.show(ui);
if let Some(path) = response.selected {
// Handle file selection
}Implementations§
Source§impl TreeView
impl TreeView
Sourcepub const fn item_height(self, height: f32) -> Self
pub const fn item_height(self, height: f32) -> Self
Set the height of each item row
Sourcepub const fn show_lines(self, show: bool) -> Self
pub const fn show_lines(self, show: bool) -> Self
Show tree connection lines
Sourcepub fn is_expanded(&self, path: &Path) -> bool
pub fn is_expanded(&self, path: &Path) -> bool
Check if branch is expanded
Sourcepub fn show(&mut self, ui: &mut Ui) -> TreeViewResponse
pub fn show(&mut self, ui: &mut Ui) -> TreeViewResponse
Show the tree view
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TreeView
impl<'de> Deserialize<'de> for TreeView
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TreeView
impl RefUnwindSafe for TreeView
impl Send for TreeView
impl Sync for TreeView
impl Unpin for TreeView
impl UnsafeUnpin for TreeView
impl UnwindSafe for TreeView
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
Mutably borrows from an owned value. Read more