mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix preferred height for JComboBox too
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user