Skip to content

Commit

Permalink
Merge pull request #1129 from yousiqi/master
Browse files Browse the repository at this point in the history
Fix TabPane close button display problem
  • Loading branch information
jfoenixadmin authored Aug 20, 2020
2 parents 83a278d + 6e01d86 commit c54ed66
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions jfoenix/src/main/java/com/jfoenix/skins/JFXTabPaneSkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -1056,10 +1056,9 @@ private void updateSkinnableUI(){
}

private boolean showCloseButton() {
return tab.isClosable() &&
(getSkinnable().getTabClosingPolicy().equals(TabPane.TabClosingPolicy.ALL_TABS));
// ||
// getSkinnable().getTabClosingPolicy().equals(TabPane.TabClosingPolicy.SELECTED_TAB) && tab.isSelected());
boolean allTabsPolicy = getSkinnable().getTabClosingPolicy().equals(TabPane.TabClosingPolicy.ALL_TABS);
boolean selectedTabPolicy = getSkinnable().getTabClosingPolicy().equals(TabPane.TabClosingPolicy.SELECTED_TAB) && tab.isSelected();
return (tab.isClosable() && (allTabsPolicy || selectedTabPolicy));
}

private void removeListeners() {
Expand Down

0 comments on commit c54ed66

Please sign in to comment.