Skip to content

Commit

Permalink
Update paging controls visibility logic and demo layout
Browse files Browse the repository at this point in the history
Adjusted the visibility criteria for message labels in PagingControlsSkin to consider page size. Also included page size property in bindings. Corrected the VBox layout in PagingControlsApp demo to include flowPane. Removed an unnecessary line break in the PagingControls class.
  • Loading branch information
dlemmermann committed Sep 26, 2024
1 parent 085c221 commit cca6192
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private VBox createSection(int pageSize, int itemCount, MessageLabelStrategy mes
flowPane.setVgap(10);
flowPane.setHgap(20);

VBox vBox = new VBox(10, pagingControls); //, flowPane);
VBox vBox = new VBox(10, pagingControls, flowPane);
vBox.setMaxHeight(Region.USE_PREF_SIZE);

return vBox;
Expand Down
1 change: 0 additions & 1 deletion gemsfx/src/main/java/com/dlsc/gemsfx/PagingControls.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public PagingControls() {
int endIndex = startIndex + getPageSize() - 1;

endIndex = Math.min(endIndex, getTotalItemCount());

return "Showing items " + startIndex + " to " + endIndex + " of " + getTotalItemCount();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ private void createButtons() {
return switch (messageLabelStrategy) {
case ALWAYS_SHOW -> true;
case HIDE -> false;
case SHOW_WHEN_NEEDED -> view.getTotalItemCount() > 0;
case SHOW_WHEN_NEEDED -> view.getTotalItemCount() > view.getPageSize();
};
}, view.messageLabelStrategyProperty(), view.totalItemCountProperty()));
}, view.messageLabelStrategyProperty(), view.totalItemCountProperty(), view.pageSizeProperty()));
messageLabel.managedProperty().bind(messageLabel.visibleProperty());

firstPageButton = createFirstPageButton();
Expand Down

0 comments on commit cca6192

Please sign in to comment.