@Override
  protected Dimension getSizeWithButtons(Insets i, Dimension size) {
    int iconWidth = DEFAULT_ICON.getIconWidth() + i.right;
    int iconHeight = DEFAULT_ICON.getIconHeight() + i.top + i.bottom;

    Dimension themeMinimumSize = JBUI.CurrentTheme.Spinner.minimumSize();
    Dimension minSize = new Dimension(i.left + themeMinimumSize.width + i.right,
                                      Math.max(i.top + themeMinimumSize.height + i.bottom, iconHeight));
    size = maximize(size, minSize);

    Dimension editorSize = spinner.getEditor() != null ? spinner.getEditor().getPreferredSize() : JBUI.emptySize();
    Insets m = editorMargins();

    return new Dimension(Math.max(size.width, i.left + m.left + editorSize.width + m.right + iconWidth),
                         Math.max(size.height, i.top + m.top + editorSize.height + m.bottom + i.bottom));
  }
@Override
  protected Dimension getSizeWithButtons(Insets i, Dimension size)