Skip to content

Commit

Permalink
When right aligned, we add the default 10 padding size so the cell's …
Browse files Browse the repository at this point in the history
…width is not smaller with a filter.
  • Loading branch information
Maxoudela committed Apr 17, 2018
1 parent a8f357b commit 87a2034
Showing 1 changed file with 5 additions and 11 deletions.
Expand Up @@ -139,6 +139,8 @@ protected double computePrefWidth(double height, double topInset, double rightIn
//Add twice the filter width in order to be well centered so the
//text is not hovered by the filter.
return cellWidth + (2 * filterWidth);
default:
return cellWidth + 10;
}
}
return cellWidth;
Expand Down Expand Up @@ -173,17 +175,9 @@ private void handleFilter(double x, final double y, final double w, final double
if (!getChildren().contains(filterButton)) {
getChildren().add(filterButton);
}

layoutInArea(filterButton, x, y, w, h, 0, new Insets(0), HPos.RIGHT, VPos.BOTTOM);
/**
* The right padding is applied to our filter, but we want it to
* always be in the bottom-right corner.
*/
if (getSkinnable().getPadding().getRight() != 0) {
filterButton.setTranslateX(getSkinnable().getPadding().getRight());
} else {
filterButton.setTranslateX(0);
}

//We add the insets to really stick to the bottom-right even with padding.
layoutInArea(filterButton, x + snappedRightInset(), y + snappedBottomInset(), w, h, 0, new Insets(0), HPos.RIGHT, VPos.BOTTOM);
} else if (filterButton != null) {
removeMenuButton();
}
Expand Down

0 comments on commit 87a2034

Please sign in to comment.