pub struct CollapsingHeader<T> { /* private fields */ }
Expand description

Builder for a collapsing header widget

Implementations§

source§

impl<T: AsRef<str>> CollapsingHeader<T>

source

pub fn new(label: T) -> CollapsingHeader<T>

Constructs a new collapsing header builder

source

pub fn flags(self, flags: TreeNodeFlags) -> Self

Replaces all current settings with the given flags.

source

pub fn allow_item_overlap(self, value: bool) -> Self

Enables/disables allowing the collapsing header to overlap subsequent widgets.

Disabled by default.

source

pub fn default_open(self, value: bool) -> Self

Sets the default open state for the collapsing header.

Collapsing headers are closed by default.

source

pub fn open_on_double_click(self, value: bool) -> Self

Only open when the collapsing header is double-clicked.

Disabled by default.

source

pub fn open_on_arrow(self, value: bool) -> Self

Only open when clicking the arrow part of the collapsing header.

Disabled by default.

source

pub fn leaf(self, value: bool) -> Self

Enable/disables leaf mode (no collapsing, no arrow).

Disabled by default.

source

pub fn bullet(self, value: bool) -> Self

Display a bullet instead of arrow.

Disabled by default.

source

pub fn frame_padding(self, value: bool) -> Self

Use frame_padding to vertically align text baseline to regular widget height.

Disabled by default.

source

pub fn begin(self, ui: &Ui<'_>) -> bool

Begins the collapsing header.

Returns true if the collapsing header is open and content should be rendered.

This is the same as build but is provided for consistent naming.

source

pub fn begin_with_close_button(self, ui: &Ui<'_>, opened: &mut bool) -> bool

Begins the collapsing header.

Returns true if the collapsing header is open and content should be rendered.

This is the same as build_with_close_button but is provided for consistent naming.

source

pub fn build(self, ui: &Ui<'_>) -> bool

Builds the collapsing header.

Returns true if the collapsing header is open and content should be rendered.

source

pub fn build_with_close_button(self, ui: &Ui<'_>, opened: &mut bool) -> bool

Builds the collapsing header, and adds an additional close button that changes the value of the given mutable reference when clicked.

Returns true if the collapsing header is open and content should be rendered.

Trait Implementations§

source§

impl<T: Clone> Clone for CollapsingHeader<T>

source§

fn clone(&self) -> CollapsingHeader<T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for CollapsingHeader<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Copy> Copy for CollapsingHeader<T>

Auto Trait Implementations§

§

impl<T> Freeze for CollapsingHeader<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for CollapsingHeader<T>
where T: RefUnwindSafe,

§

impl<T> Send for CollapsingHeader<T>
where T: Send,

§

impl<T> Sync for CollapsingHeader<T>
where T: Sync,

§

impl<T> Unpin for CollapsingHeader<T>
where T: Unpin,

§

impl<T> UnwindSafe for CollapsingHeader<T>
where T: UnwindSafe,

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.