Struct TreeViewProps
pub struct TreeViewProps {Show 15 fields
pub name: Option<String>,
pub fill: bool,
pub hide_root: bool,
pub single_click: bool,
pub selection_follows_focus: bool,
pub multi_select: bool,
pub reorder: bool,
pub tab_indents: bool,
pub nodes: Vec<TreeViewNodeProps>,
pub expanded: Option<Vec<ResourceId>>,
pub selection: Option<Vec<ResourceId>>,
pub motion: Option<Feel>,
pub select: Event,
pub activate: Event,
pub drop: Event,
}Expand description
A tree of nodes: a file explorer, a project’s files, the layers of a drawing, a book’s pages. Each node is the resource it stands for; opening a branch shows the nodes under it, and selecting or activating a node reports its resource.
Fields§
§name: Option<String>What the tree is, for assistive technology.
fill: boolThe tree takes the height it is given and scrolls inside itself, rather than sizing to the rows inside another scroll.
hide_root: boolThe tree’s root node — the tree itself, labelled with its name — is not a row: the
nodes at the top level are, at the first depth. Off, the tree’s name stands over them
as a row of its own. Hide it where a heading or a page title already names the tree.
single_click: boolA press selects and activates in one, as a navigator sidebar does; a double click activates otherwise.
selection_follows_focus: boolMoving through the rows with the keyboard selects them as it goes.
multi_select: boolWhether several nodes may be selected at once (Ctrl-click, Shift-click).
reorder: boolRows move: by dragging one onto another (before it, inside it or after it), and by
Tab and Shift-Tab to indent and outdent, Alt-Up and Alt-Down to reorder among
siblings. A move is reported by the node it lands at
(TreeViewNodeProps::drop, TreeViewNodeProps::into) or, at the top level’s end,
by the tree’s Self::drop.
tab_indents: boolTab and Shift-Tab indent and outdent the focused row. On by itself with
Self::reorder; off, Tab moves the focus on as it otherwise would.
nodes: Vec<TreeViewNodeProps>The nodes, in order, parents before their children.
expanded: Option<Vec<ResourceId>>The nodes open now, by the resource each stands for. Given, it is where the view says the tree is; without it the tree keeps what a person opened.
selection: Option<Vec<ResourceId>>The nodes selected, by the resource each stands for.
motion: Option<Feel>The pace its own motion plays at: branches unfolding, rows arriving and leaving. Unset, the theme’s.
select: EventA node was selected: carries the resource it shows.
activate: EventA node was activated (a double click, Enter, an assistive technology): carries the resource it shows.
drop: EventA node was dropped at the end of the top level, past every row: carries the node that moved.
Trait Implementations§
§impl Component for TreeViewProps
impl Component for TreeViewProps
fn describe() -> Description
§fn from_source(source: &mut dyn Source) -> Result<TreeViewProps, Error>
fn from_source(source: &mut dyn Source) -> Result<TreeViewProps, Error>
source gives. Read more§impl Default for TreeViewProps
impl Default for TreeViewProps
§fn default() -> TreeViewProps
fn default() -> TreeViewProps
Auto Trait Implementations§
impl Freeze for TreeViewProps
impl !RefUnwindSafe for TreeViewProps
impl !Send for TreeViewProps
impl !Sync for TreeViewProps
impl Unpin for TreeViewProps
impl UnsafeUnpin for TreeViewProps
impl !UnwindSafe for TreeViewProps
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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