Browse Source

REPORT-90581 设计器添加事件菜单没有充满,存在留白

feature/x
Destiny.Lin 2 years ago
parent
commit
bbc5a3f916
  1. 13
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

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

@ -28,14 +28,7 @@ import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.lang.reflect.Constructor;
@ -336,7 +329,9 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
Map.Entry<String, ListWrapperPane> entry = iterator.next();
ListWrapperPane wrapperPane = entry.getValue();
UIList uiList = wrapperPane.getNameEdList();
uiList.setFixedCellWidth(width);
//contentPane是外层的Panel,如果不进行判断的话宽度就可能会小于contentPanel,右侧会有空隙
//所以需要判断一下,如果外层比较宽就取外层的宽度,防止空隙出现
uiList.setFixedCellWidth(Math.max(width, contentPane == null? 0 : contentPane.getWidth()));
}
}

Loading…
Cancel
Save