From 803219136682f6f669d93634750c6f4ba4c37f9d Mon Sep 17 00:00:00 2001 From: Florian Dehau Date: Sun, 21 Nov 2021 20:47:04 +0100 Subject: [PATCH] chore: fix table example Third column in table example was using the `Max` constraint. But since version 0.16, the layout system does not add a hidden constraint on the last column which would ensure that it fills the remaining available space (a change that was already mentioned in #525). In addition, `tui` does not support sizing based on content because of its immediate mode nature. Therefore, `Max` is now resolved to `0`. Replacing with `Min` fixes the issue. A new way of specifying constraints is being worked on at #519 which should for more deterministic and advanced layout. --- examples/table.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/table.rs b/examples/table.rs index 354bb98..ce013f2 100644 --- a/examples/table.rs +++ b/examples/table.rs @@ -149,7 +149,7 @@ fn ui(f: &mut Frame, app: &mut App) { .widths(&[ Constraint::Percentage(50), Constraint::Length(30), - Constraint::Max(10), + Constraint::Min(10), ]); f.render_stateful_widget(t, rects[0], &mut app.state); }