Skip to content

Set a max height for ui.collapsing #5340

Answered by attran1
attran1 asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for your suggestion. I have implemented similar solution creating Windows with anchor and positioning. It does not meet my need because I want to allow customer to collapse the header so that they can have real estate to look at the body.

I took your example and modified as such. Now the codes below meet my requirements.

Anthony

    SidePanel::left("input")
        .exact_width(450.0)
        .show(ctx, |ui: &mut Ui|{

        ScrollArea::vertical().max_height(self.height1).id_salt("Input Header")
        .show(ui, |ui: &mut Ui|{
            ui.collapsing("document header", |ui| {
                ui.with_layout(egui::Layout::top_down_justified(egui::Align::LEFT), |ui| {
        …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@attran1
Comment options

Answer selected by attran1
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