pub struct FileTreeState { /* private fields */ }Expand description
File tree widget state
Implementations§
Source§impl FileTreeState
impl FileTreeState
Sourcepub fn from_paths(
paths: &[PathBuf],
git_statuses: &[(PathBuf, FileGitStatus)],
) -> Self
pub fn from_paths( paths: &[PathBuf], git_statuses: &[(PathBuf, FileGitStatus)], ) -> Self
Build tree from a list of file paths
Sourcepub fn selected_entry(&mut self) -> Option<FlatEntry>
pub fn selected_entry(&mut self) -> Option<FlatEntry>
Get selected entry
Sourcepub fn selected_path(&mut self) -> Option<PathBuf>
pub fn selected_path(&mut self) -> Option<PathBuf>
Get selected path
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection up
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Move selection down
Sourcepub fn select_first(&mut self)
pub fn select_first(&mut self)
Jump to first item
Sourcepub fn select_last(&mut self)
pub fn select_last(&mut self)
Jump to last item
Sourcepub fn toggle_expand(&mut self)
pub fn toggle_expand(&mut self)
Toggle expansion of selected item
Sourcepub fn expand_all(&mut self)
pub fn expand_all(&mut self)
Expand all directories
Sourcepub fn collapse_all(&mut self)
pub fn collapse_all(&mut self)
Collapse all directories
Sourcepub fn expand_to_depth(&mut self, max_depth: usize)
pub fn expand_to_depth(&mut self, max_depth: usize)
Expand directories up to a certain depth
Sourcepub fn update_scroll(&mut self, visible_height: usize)
pub fn update_scroll(&mut self, visible_height: usize)
Update scroll offset based on area height
Sourcepub fn scroll_offset(&self) -> usize
pub fn scroll_offset(&self) -> usize
Get current scroll offset
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get selected index
Sourcepub fn select_by_row(&mut self, row: usize) -> bool
pub fn select_by_row(&mut self, row: usize) -> bool
Select an item by visible row (for mouse clicks) Returns true if selection changed, false otherwise
Sourcepub fn is_row_selected(&self, row: usize) -> bool
pub fn is_row_selected(&self, row: usize) -> bool
Check if the clicked row matches the currently selected item Used for double-click detection
Sourcepub fn handle_click(&mut self, row: usize) -> (bool, bool)
pub fn handle_click(&mut self, row: usize) -> (bool, bool)
Handle mouse click at a specific row within the visible area.
Returns a tuple of (selection_changed, is_directory) for the caller to handle.
Trait Implementations§
Source§impl Clone for FileTreeState
impl Clone for FileTreeState
Source§fn clone(&self) -> FileTreeState
fn clone(&self) -> FileTreeState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileTreeState
impl Debug for FileTreeState
Auto Trait Implementations§
impl Freeze for FileTreeState
impl RefUnwindSafe for FileTreeState
impl Send for FileTreeState
impl Sync for FileTreeState
impl Unpin for FileTreeState
impl UnwindSafe for FileTreeState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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