Browse Source

REPORT-73262【设计器环境监测】右下角弹窗文字显示不全

rt, 使用 scrollPanel 的时候需要计算宽度
feature/x
Harrison 2 years ago
parent
commit
5d277b9835
  1. 5
      designer-base/src/main/java/com/fr/design/components/notification/NotificationDialog.java

5
designer-base/src/main/java/com/fr/design/components/notification/NotificationDialog.java

@ -184,7 +184,10 @@ public class NotificationDialog extends JDialog {
int widthUnit = messageComponents.stream() int widthUnit = messageComponents.stream()
.map((component) -> { .map((component) -> {
Dimension preferredSize = component.getPreferredSize(); Dimension preferredSize = component.getPreferredSize();
return preferredSize.getHeight(); double width = preferredSize.getWidth();
double widthFactor = Math.ceil(width / CONTENT_WIDTH);
// 这里的高度是没有限制宽度的,如果限制宽度,高度会变更,所以这里需要加上宽度的影响
return preferredSize.getHeight() + widthFactor * SIGN_LABEL_DIMENSION.getHeight();
}) })
.reduce(Double::sum) .reduce(Double::sum)
.map(calStandardWidth) .map(calStandardWidth)

Loading…
Cancel
Save