-
I have multiple columns containing a scroll-able custom widget. I'd like this ScrollArea to take up all remaining vertical space but they seem to be stuck at some minimum height. I created a minimal test: struct TestApp;
impl epi::App for TestApp {
fn name(&self) -> &str {
"TestApp"
}
fn update(&mut self, ctx: &egui::Context, _frame: &epi::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.horizontal(|ui| {
egui::ScrollArea::vertical()
.id_source("first")
.show(ui, |ui| {
ui.add_sized([100., 200.], egui::Button::new("First"));
});
egui::ScrollArea::vertical()
.id_source("second")
.show(ui, |ui| {
ui.add_sized([100., 200.], egui::Button::new("Second"));
});
});
});
}
} I tried Is this a limitation inside a horizontal layout? I guess I could layout my columns manually to better control the sizes. |
Beta Was this translation helpful? Give feedback.
Answered by
exoticorn
Mar 20, 2022
Replies: 1 comment 1 reply
-
Of course, right after posting the question I found the answer myself: Just replace ui.with_layout(egui::Layout::left_to_right().with_cross_justify(true), |ui| { |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
exoticorn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Of course, right after posting the question I found the answer myself: Just replace
ui::horizontal(...)
with