summaryrefslogtreecommitdiff
path: root/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java')
-rw-r--r--platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java b/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java
index 6f38d9a96356..101444a9d649 100644
--- a/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java
+++ b/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java
@@ -87,7 +87,7 @@ public class FixedSizeButton extends JButton {
public Dimension getPreferredSize() {
if (myComponent != null) {
int size = myComponent.getPreferredSize().height;
- if (myComponent instanceof ComboBox && (UIUtil.isUnderIntelliJLaF() || UIUtil.isUnderDarcula())) {
+ if (myComponent instanceof JComboBox && (UIUtil.isUnderIntelliJLaF() || UIUtil.isUnderDarcula())) {
size -= 2; // decrement to match JTextField's preferred height
}
return new Dimension(size, size);
@@ -120,9 +120,7 @@ public class FixedSizeButton extends JButton {
public void setBounds(Rectangle r) {
if (r.width != r.height) {
int size = Math.min(r.width, r.height);
- r = new Rectangle(r);
- r.width = size;
- r.height = size;
+ r = new Rectangle(r.x, r.y, size, size);
}
super.setBounds(r);
}