jwill / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Wrong alignment in Table component #73

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Table component does not compute height of rows. If a component has two lines, 
and another component has one line on the same row, the alignment will be 
incorrect for the next row.

Here is a small code to reproduce the problem:
Window myWindow = new Window("Test table");
Table myTable = new Table(2);
myTable.addRow(new Label("Line 1"), new Label("Line 1\nhas\na lot\nof\nlines 
!"));
myTable.addRow(new Label("Line 2"), new Label("Line 2 has just one line"));
myWindow.addComponent(myTable);

A workaround for now is to set all component's preferred height to the same 
value before adding them to the table.

Original issue reported on code.google.com by npellegr...@gmail.com on 25 Mar 2013 at 3:06

GoogleCodeExporter commented 9 years ago
Yes, this is unfortunately a build-in problem with the way I hacked together 
the initial Table implementation. The whole class needs a re-write, really, 
I'll put it on the TODO list for the next version.

Original comment by mab...@gmail.com on 20 Apr 2013 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by mab...@gmail.com on 20 Apr 2013 at 9:12