Browse Source

REPORT-57298【回归测试】控件事件名显示完全,但出现横向滚动条

bugfix/11.0
kerry 3 years ago
parent
commit
633a29dc48
  1. 8
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

8
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -329,7 +329,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
width = Math.max(width, calculateUIListMaxCellWidth(uiList.getModel(), uiList.getFontMetrics(uiList.getFont()))); width = Math.max(width, calculateUIListMaxCellWidth(uiList.getModel(), uiList.getFontMetrics(uiList.getFont())));
} }
iterator = nameEdListMap.entrySet().iterator(); iterator = nameEdListMap.entrySet().iterator();
width += 40; width += 30;
while (iterator.hasNext()) { while (iterator.hasNext()) {
Map.Entry<String, ListWrapperPane> entry = iterator.next(); Map.Entry<String, ListWrapperPane> entry = iterator.next();
ListWrapperPane wrapperPane = entry.getValue(); ListWrapperPane wrapperPane = entry.getValue();
@ -349,7 +349,8 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
} else { } else {
text = element.toString(); text = element.toString();
} }
width = Math.max(width, fontMetrics.stringWidth(text)); //增加 10px 的左右间隔
width = Math.max(width, fontMetrics.stringWidth(text) + 10);
} }
} }
return width; return width;
@ -539,7 +540,8 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
label.setBackground(Color.WHITE); label.setBackground(Color.WHITE);
label.setForeground(Color.decode("#333334")); label.setForeground(Color.decode("#333334"));
label.setFont(label.getFont().deriveFont(11F)); label.setFont(label.getFont().deriveFont(11F));
label.setPreferredSize(new Dimension(224, 26)); //预留 10px 的纵向滚动条的宽度
label.setPreferredSize(new Dimension(214, 26));
this.nameEdList = nameEdList; this.nameEdList = nameEdList;
this.add(label, BorderLayout.NORTH); this.add(label, BorderLayout.NORTH);
this.add(this.nameEdList, BorderLayout.CENTER); this.add(this.nameEdList, BorderLayout.CENTER);

Loading…
Cancel
Save