Merge pull request #1616 from SiboVG/fix-icons-click

Fix pressed icon size of IconButton
This commit is contained in:
SiboVG 2022-08-26 16:17:12 +02:00 committed by GitHub
commit 75b10e9f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);