Fix render issue with table size

This commit is contained in:
Manfred Karrer 2018-12-12 22:51:44 +01:00
parent 9ee3c0e39b
commit ac2b9d8f1e
No known key found for this signature in database
GPG key ID: 401250966A6B2C46

View file

@ -817,7 +817,10 @@ public class GUIUtil {
tableView.setPrefHeight(-1); tableView.setPrefHeight(-1);
tableView.setVisible(false); tableView.setVisible(false);
// We need to delay the setter to the next render frame as otherwise views don' get updated in some cases // We need to delay the setter to the next render frame as otherwise views don' get updated in some cases
// Not 100% clear what causes that issue, but seems the requestLayout method is not called otherwise // Not 100% clear what causes that issue, but seems the requestLayout method is not called otherwise.
// We still need to set the height immediately, otherwise some views render a incorrect layout.
tableView.setPrefHeight(height);
UserThread.execute(() -> { UserThread.execute(() -> {
tableView.setPrefHeight(height); tableView.setPrefHeight(height);
tableView.setVisible(true); tableView.setVisible(true);