Skip to main content

TreePopup

Struct TreePopup 

Source
pub struct TreePopup<'a> { /* private fields */ }
Expand description

Popup que envuelve un Tree para mostrar una jerarquía expandible.

Compone un Popup (chrome) con un Tree (árbol). Hereda la configuración del Tree a través de builders delegados.

Implementations§

Source§

impl<'a> TreePopup<'a>

Source

pub fn new(nodes: Vec<TreeNode<'a>>) -> Self

Source

pub fn title(self, title: &'a str) -> Self

Source

pub fn cursor_style(self, style: Style) -> Self

Source

pub fn border_color(self, color: Color) -> Self

Source

pub fn border_type(self, bt: BorderType) -> Self

Source

pub fn bg_color(self, color: Color) -> Self

Source

pub fn width(self, w: PopupSize) -> Self

Source

pub fn height(self, h: PopupSize) -> Self

Source

pub fn position(self, x: u16, y: u16) -> Self

Source

pub fn origin(self, x: u16, y: u16) -> Self

Source

pub fn header(self) -> Self

Source

pub fn padding(self, p: u16) -> Self

Source

pub fn indent(self, n: u16) -> Self

Source

pub fn expand_icon(self, icon: &'a str) -> Self

Source

pub fn collapse_icon(self, icon: &'a str) -> Self

Source

pub fn leaf_icon(self, icon: &'a str) -> Self

Source

pub fn highlight_style(self, style: Style) -> Self

Source

pub fn highlight_symbol(self, symbol: &'a str) -> Self

Source

pub fn borders(self, borders: Borders) -> Self

Source

pub fn border_style(self, style: Style) -> Self

Source

pub fn no_background(self) -> Self

Source

pub fn background_dots(self, color: Color, symbol: &str, density: u16) -> Self

Source

pub fn background_pattern(self, pattern: DotPattern) -> Self

Source

pub fn background_spacing(self, density_x: u16, density_y: u16) -> Self

Source

pub fn badges(self, badges: BadgeStack<'a>) -> Self

Source§

impl<'a> TreePopup<'a>

Source

pub fn item_at( &self, state: &TreeState, popup_rect: Rect, row: u16, ) -> Option<usize>

Map a screen row to the flat visible item index at that position. Returns None if the row is in the border/header area or beyond the last visible item.

Source

pub fn resolve_rect(&self, area: Rect, state: &TreeState) -> Rect

Resolves the final Rect for this popup within the given area, using the current tree state for Auto-height resolution.

See AutoSized::auto_height.

Trait Implementations§

Source§

impl AutoSized for TreePopup<'_>

Source§

type State = TreeState

Source§

fn auto_height(&self, state: &Self::State, _area: Rect) -> u16

Returns the actual height this popup would render when its height is PopupSize::Auto, based on current content, state, and available area.
Source§

impl<'a> Clone for TreePopup<'a>

Source§

fn clone(&self) -> TreePopup<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl StatefulWidget for TreePopup<'_>

Source§

type State = TreeState

State associated with the stateful widget. Read more
Source§

fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State)

Draws the current state of the widget in the given buffer. That is the only method required to implement a custom stateful widget.

Auto Trait Implementations§

§

impl<'a> Freeze for TreePopup<'a>

§

impl<'a> RefUnwindSafe for TreePopup<'a>

§

impl<'a> Send for TreePopup<'a>

§

impl<'a> Sync for TreePopup<'a>

§

impl<'a> Unpin for TreePopup<'a>

§

impl<'a> UnsafeUnpin for TreePopup<'a>

§

impl<'a> UnwindSafe for TreePopup<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.