Skip to content

How to modify the small icon on the left side of CollapsingState #5327

Answered by YgorSouza
KUKU-zero2 asked this question in Q&A
Discussion options

You must be logged in to vote

Use show_toggle_button instead of show_header. There is an example there in the docs, but if you also want it to toggle when you click on the name, like the default header, you also have to call the toggle method that isn't mentioned in the example:

            let header_res = ui.horizontal(|ui| {
                if ui.label("Header").clicked() {
                    state.toggle(ui);
                }
                state.show_toggle_button(ui, circle_icon);
            });

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KUKU-zero2
Comment options

Answer selected by KUKU-zero2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants