Struct egui::containers::CollapsingHeader [−][src]
A header which can be collapsed/expanded, revealing a contained Ui
region.
egui::CollapsingHeader::new("Heading") .show(ui, |ui| { ui.label("Contents"); }); // Short version: ui.collapsing("Heading", |ui| { ui.label("Contents"); });
Implementations
impl CollapsingHeader
[src]
pub fn new(label: impl Into<String>) -> Self
[src]
The CollapsingHeader
starts out collapsed unless you call default_open
.
The label is used as an Id
source.
If the label is unique and static this is fine,
but if it changes or there are several CollapsingHeader
with the same title
you need to provide a unique id source with Self::id_source
.
pub fn default_open(self, open: bool) -> Self
[src]
By default, the CollapsingHeader
is collapsed.
Call .default_open(true)
to change this.
pub fn id_source(self, id_source: impl Hash) -> Self
[src]
Explicitly set the source of the Id
of this widget, instead of using title label.
This is useful if the title label is dynamic or not unique.
impl CollapsingHeader
[src]
pub fn show<R>(
self,
ui: &mut Ui,
add_contents: impl FnOnce(&mut Ui) -> R
) -> CollapsingResponse<R>
[src]
self,
ui: &mut Ui,
add_contents: impl FnOnce(&mut Ui) -> R
) -> CollapsingResponse<R>
Auto Trait Implementations
impl RefUnwindSafe for CollapsingHeader
impl Send for CollapsingHeader
impl Sync for CollapsingHeader
impl Unpin for CollapsingHeader
impl UnwindSafe for CollapsingHeader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,