Skip to content

Commit

Permalink
Update JFXTabPaneSkin.java
Browse files Browse the repository at this point in the history
fixed display close button
  • Loading branch information
yousiqi authored Jul 12, 2020
1 parent fb03a39 commit 6e01d86
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 6e01d86

Please sign in to comment.