Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical Centered expands to infinity #4039

Open
DasLixou opened this issue Feb 13, 2024 · 5 comments
Open

Vertical Centered expands to infinity #4039

DasLixou opened this issue Feb 13, 2024 · 5 comments
Labels
bug Something is broken layout Related to widget layout

Comments

@DasLixou
Copy link

Describe the bug
When having two vertical_centered stacks horizontally next to each other, they grow bigger on every mouse move. (could be a duplicate of #2815 but it's described differently so I'm not sure)

To Reproduce

ui.horizontal(|ui| {
    ui.vertical_centered(|ui| {
        ui.label("Volume");
        ui.label("Text");
    });
    ui.vertical_centered(|ui| {
        ui.label("Pan");
        ui.label("Other Text");
    });
}

Expected behavior
Having the minimal size of them next by each other.

Screenshots
https://github.com/emilk/egui/assets/82600264/fbe3173e-31f8-4b05-8ba8-b6b71dbe1202

@DasLixou DasLixou added the bug Something is broken label Feb 13, 2024
@rustbasic
Copy link
Contributor

It would be a little better if you added .scroll2([true, true]) to the options of egui::Window.

                 .scroll2([true, true])

@DasLixou
Copy link
Author

It would be a little better if you added .scroll2([true, true]) to the options of egui::Window.

                 .scroll2([true, true])

why? I don't want to scroll behind my content, it should be in the small window

@rustbasic
Copy link
Contributor

I mean temporary.

                    ui.horizontal(|ui| {
                        ui.vertical_centered(|ui| {
                            ui.label("Volume");
                            ui.label("Text");
                        });
                    });
                    ui.horizontal(|ui| {
                        ui.vertical_centered(|ui| {
                            ui.label("Pan");
                            ui.label("Other Text");
                        });
                    });

@DasLixou
Copy link
Author

But scrolling wouldn't help because it would grow larger every time I update, so also on scroll.
And having two horizontal things there would just make it stacked vertically, right? meh.

@rustbasic
Copy link
Contributor

But scrolling wouldn't help because it would grow larger every time I update, so also on scroll.
And having two horizontal things there would just make it stacked vertically, right? meh.

Yes, you will have to find a temporary solution and use it until the bug is fixed.

@emilk emilk added the layout Related to widget layout label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken layout Related to widget layout
Projects
None yet
Development

No branches or pull requests

3 participants