mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
FlatContainerTest: test disabled tab icons
This commit is contained in:
@@ -168,12 +168,21 @@ public class FlatContainerTest
|
|||||||
boolean showTabIcons = tabIconsCheckBox.isSelected();
|
boolean showTabIcons = tabIconsCheckBox.isSelected();
|
||||||
Object iconSize = tabIconSizeSpinner.getValue();
|
Object iconSize = tabIconSizeSpinner.getValue();
|
||||||
|
|
||||||
Icon icon = showTabIcons
|
Icon icon = null;
|
||||||
? new ScaledImageIcon( new ImageIcon( getClass().getResource( "/com/formdev/flatlaf/testing/test" + iconSize + ".png" ) ) )
|
Icon disabledIcon = null;
|
||||||
: null;
|
if( showTabIcons ) {
|
||||||
|
ImageIcon imageIcon = new ImageIcon( getClass().getResource( "/com/formdev/flatlaf/testing/test" + iconSize + ".png" ) );
|
||||||
|
icon = new ScaledImageIcon( imageIcon );
|
||||||
|
disabledIcon = UIManager.getLookAndFeel().getDisabledIcon( tabbedPane, imageIcon );
|
||||||
|
if( disabledIcon instanceof ImageIcon )
|
||||||
|
disabledIcon = new ScaledImageIcon( (ImageIcon) disabledIcon );
|
||||||
|
}
|
||||||
|
|
||||||
int tabCount = tabbedPane.getTabCount();
|
int tabCount = tabbedPane.getTabCount();
|
||||||
for( int i = 0; i < tabCount; i++ )
|
for( int i = 0; i < tabCount; i++ ) {
|
||||||
tabbedPane.setIconAt( i, icon );
|
tabbedPane.setIconAt( i, icon );
|
||||||
|
tabbedPane.setDisabledIconAt( i, disabledIcon );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void iconPlacementChanged() {
|
private void iconPlacementChanged() {
|
||||||
|
|||||||
Reference in New Issue
Block a user