private void updateListHeight() { final double height = Math.min(suggestionList.getItems().size(), getSkinnable().getCellLimit()) * suggestionList.getFixedCellSize(); suggestionList.setPrefHeight(height + suggestionList.getFixedCellSize() / 2); }
@Override protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { final int itemsCount = getSkinnable().getItems().size(); if (getSkinnable().maxHeightProperty().isBound() || itemsCount <= 0) { return super.computePrefHeight(width, topInset, rightInset, bottomInset, leftInset); } final double fixedCellSize = getSkinnable().getFixedCellSize(); double computedHeight = fixedCellSize != Region.USE_COMPUTED_SIZE ? fixedCellSize * itemsCount + snapVerticalInsets() : estimateHeight(); double height = super.computePrefHeight(width, topInset, rightInset, bottomInset, leftInset); if (height > computedHeight) { height = computedHeight; } if (getSkinnable().getMaxHeight() > 0 && computedHeight > getSkinnable().getMaxHeight()) { return getSkinnable().getMaxHeight(); } return height; }
if (index > -1) { cell.setOpacity(0); cell.setTranslateY(-suggestionList.getFixedCellSize() / 8); Timeline f = new Timeline(new KeyFrame(Duration.millis(120), end -> {
private void updateListHeight() { final double height = Math.min(suggestionList.getItems().size(), getSkinnable().getCellLimit()) * suggestionList.getFixedCellSize(); suggestionList.setPrefHeight(height + suggestionList.getFixedCellSize() / 2); }
@Override protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) { final int itemsCount = getSkinnable().getItems().size(); if (getSkinnable().maxHeightProperty().isBound() || itemsCount <= 0) { return super.computePrefHeight(width, topInset, rightInset, bottomInset, leftInset); } final double fixedCellSize = getSkinnable().getFixedCellSize(); double computedHeight = fixedCellSize != Region.USE_COMPUTED_SIZE ? fixedCellSize * itemsCount + snapVerticalInsets() : estimateHeight(); double height = super.computePrefHeight(width, topInset, rightInset, bottomInset, leftInset); if (height > computedHeight) { height = computedHeight; } if (getSkinnable().getMaxHeight() > 0 && computedHeight > getSkinnable().getMaxHeight()) { return getSkinnable().getMaxHeight(); } return height; }
if (index > -1) { cell.setOpacity(0); cell.setTranslateY(-suggestionList.getFixedCellSize() / 8); Timeline f = new Timeline(new KeyFrame(Duration.millis(120), end -> {