Browse Source

ComboBox: Fix incorrect height for small popups

pull/336/head
Jannis Weis 2 years ago
parent
commit
a5412e8e49
No known key found for this signature in database
GPG Key ID: 7C9D8D4B558049AB
  1. 6
      core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboPopup.java

6
core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboPopup.java

@ -134,11 +134,13 @@ public class DarkComboPopup extends BasicComboPopup {
protected Point getPopupLocation() {
scroller.setPreferredSize(null);
Insets ins = getInsets();
Dimension dim = getPreferredSize();
dim.height = getPopupHeightForRowCount(comboBox.getMaximumRowCount());
int scrollHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount());
dim.height = scrollHeight + ins.top + ins.bottom;
Dimension parentSize = comboBox.getSize();
Insets ins = getInsets();
parentSize.width -= ins.left + ins.right;
dim.width -= ins.left + ins.right;

Loading…
Cancel
Save