Merge pull request #2108 from ManfredKarrer/fix-missing-layout-update

Fix missing render update issue
This commit is contained in:
Christoph Atteneder 2018-12-11 14:30:29 +01:00 committed by GitHub
commit 63b7c2c75d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -813,10 +813,15 @@ public class GUIUtil {
int maxHeight = rowHeight * maxNumRows + headerHeight;
checkArgument(maxHeight >= minHeight, "maxHeight cannot be smaller as minHeight");
int height = Math.min(maxHeight, Math.max(minHeight, size * rowHeight + headerHeight));
tableView.setMaxHeight(-1);
tableView.setMinHeight(-1);
tableView.setMaxHeight(height);
tableView.setMinHeight(height);
tableView.setPrefHeight(-1);
tableView.setVisible(false);
// 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
UserThread.execute(() -> {
tableView.setPrefHeight(height);
tableView.setVisible(true);
});
}
public static Tuple2<ComboBox<TradeCurrency>, Integer> addRegionCountryTradeCurrencyComboBoxes(GridPane gridPane,