respect action button minimum size appcode/142.515 clion/142.516 phpstorm/142.514 phpstorm/142.517
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Sat, 28 Mar 2015 07:22:06 +0000 (10:22 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Sat, 28 Mar 2015 07:22:06 +0000 (10:22 +0300)
platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java

index 203605cdad087e0a32cdaac5c25d21c8b5285c2f..51b8c464a9235a34f456055a6aaa187c60940c5a 100644 (file)
@@ -71,7 +71,6 @@ public class ActionButton extends JComponent implements ActionButtonComponent, A
     myPlace = place;
     setFocusable(false);
     enableEvents(AWTEvent.MOUSE_EVENT_MASK);
     myPlace = place;
     setFocusable(false);
     enableEvents(AWTEvent.MOUSE_EVENT_MASK);
-    myMinimumButtonSize = JBDimension.create(minimumSize);
 
     putClientProperty(UIUtil.CENTER_TOOLTIP_DEFAULT, Boolean.TRUE);
   }
 
     putClientProperty(UIUtil.CENTER_TOOLTIP_DEFAULT, Boolean.TRUE);
   }
@@ -196,8 +195,8 @@ public class ActionButton extends JComponent implements ActionButtonComponent, A
     }
     else {
       return new Dimension(
     }
     else {
       return new Dimension(
-        icon.getIconWidth() + myInsets.left + myInsets.right,
-        icon.getIconHeight() + myInsets.top + myInsets.bottom
+        Math.max(myMinimumButtonSize.width, icon.getIconWidth() + myInsets.left + myInsets.right),
+        Math.max(myMinimumButtonSize.height, icon.getIconHeight() + myInsets.top + myInsets.bottom)
       );
     }
   }
       );
     }
   }