Expander is a simple collapsible container that has a header and collapsible/expandable content zone. It is used to
create collapsible regions with headers.
It is possible to completely change the arrow of the header of the expander. By default, the arrow consists
of crate::check_box::CheckBox widget. By changing the arrow, you can customize the look of the header.
For example, you can set the new check box with image check marks, which will use custom graphics:
#![allow(unused)]fnmain() {
fncreate_expander_with_image(ctx: &mut BuildContext) -> Handle<UiNode> {
ExpanderBuilder::new(WidgetBuilder::new())
.with_checkbox(
CheckBoxBuilder::new(WidgetBuilder::new())
.with_check_mark(
ImageBuilder::new(WidgetBuilder::new().with_height(16.0).with_height(16.0))
.with_opt_texture(None) // Set this to required image.
.build(ctx),
)
.with_uncheck_mark(
ImageBuilder::new(WidgetBuilder::new().with_height(16.0).with_height(16.0))
.with_opt_texture(None) // Set this to required image.
.build(ctx),
)
.build(ctx),
)
// The rest is omitted.
.build(ctx)
}
}