ActionButton (@NotNull AnAction action, @NotNull String place, @NotNull Presentation presentation, Supplier<? extends @NotNull Dimension> minimumSize) { return new ActionButton(action, presentation, place, minimumSize) { @Override public void updateIcon() { super.updateIcon(); revalidate(); repaint(); } @Override public @NotNull Insets getInsets() { return myAction == nextErrorAction ? JBUI.insets(2, 1) : myAction == prevErrorAction ? JBUI.insets(2, 1, 2, 2) : JBUI.insets(2); } @Override public @NotNull Dimension getPreferredSize() { Icon icon = getIcon(); Dimension size = new Dimension(icon.getIconWidth(), icon.getIconHeight()); int minSize = getStatusIconSize(); size.width = Math.max(size.width, minSize); size.height = Math.max(size.height, minSize); JBInsets.addTo(size, getInsets()); return size; } }; }