Skip to content

Commit

Permalink
crates: egui_demo_lib: Fix table height (#4422)
Browse files Browse the repository at this point in the history
* Closes #4404

Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric authored Apr 29, 2024
1 parent 3bb3398 commit af39bd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/egui_demo_lib/src/demo/table_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl TableDemo {
.size
.max(ui.spacing().interact_size.y);

let available_height = ui.available_height();
let mut table = TableBuilder::new(ui)
.striped(self.striped)
.resizable(self.resizable)
Expand All @@ -145,7 +146,8 @@ impl TableDemo {
.column(Column::initial(100.0).range(40.0..=300.0))
.column(Column::initial(100.0).at_least(40.0).clip(true))
.column(Column::remainder())
.min_scrolled_height(0.0);
.min_scrolled_height(0.0)
.max_scroll_height(available_height);

if self.clickable {
table = table.sense(egui::Sense::click());
Expand Down

0 comments on commit af39bd2

Please sign in to comment.