IconButton add pressed icon override
This commit is contained in:
parent
1c38aa4dd4
commit
aa0c119a58
@ -38,6 +38,13 @@ public class IconButton extends SelectColorButton {
|
||||
setIconTextGap(ICON_GAP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIcon(Icon defaultIcon) {
|
||||
super.setIcon(defaultIcon);
|
||||
// There is a bug where the normal override of the pressed icon does not work, so we have to assign it here.
|
||||
setPressedIcon(Icons.getScaledIcon(defaultIcon, ICON_SCALE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return Icons.getScaledIcon(super.getIcon(), IconButton.ICON_SCALE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user