Struct egui::containers::CollapsingHeader [−][src]
pub struct CollapsingHeader { /* fields omitted */ }
Expand description
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
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
.
By default, the CollapsingHeader
is collapsed.
Call .default_open(true)
to change this.
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.
By default, the CollapsingHeader
text style is TextStyle::Button
.
Call .text_style(style)
to change this.
If you set this to false
, the CollapsingHeader
will be grayed out and un-clickable.
This is a convenience for Ui::set_enabled
.