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) -> TreeView
pub const fn item_height(self, height: f32) -> TreeView
Set the height of each item row
Sourcepub const fn show_lines(self, show: bool) -> TreeView
pub const fn show_lines(self, show: bool) -> TreeView
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<TreeView, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TreeView, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TreeView
impl Serialize for TreeView
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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