TabbedPane: custom TabbedPane.selectedForeground color did not work when TabbedPane.foreground has also custom color (issue #257)

This commit is contained in:
Karl Tauber
2021-02-11 12:04:36 +01:00
parent 140ebfdb92
commit b5fc07acc7
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,14 @@
FlatLaf Change Log
==================
## 1.0-rc4-SNAPSHOT
#### Fixed bugs
- TabbedPane: Custom `TabbedPane.selectedForeground` color did not work when
`TabbedPane.foreground` has also custom color. (issue #257)
## 1.0-rc3
#### New features and improvements

View File

@@ -893,7 +893,7 @@ public class FlatTabbedPaneUI
Color color;
if( tabPane.isEnabled() && tabPane.isEnabledAt( tabIndex ) ) {
color = tabPane.getForegroundAt( tabIndex );
if( isSelected && (color instanceof UIResource) && selectedForeground != null )
if( isSelected && selectedForeground != null && color == tabPane.getForeground() )
color = selectedForeground;
} else
color = disabledForeground;