Browse Source

REPORT-55629 【组件背景分离】组件复用-控件/组件刚拖入设计画布时,工具栏没加载完全,只显示了一条线,移动鼠标的话才显示正常

final/10.0
hades 3 years ago
parent
commit
5cd2c395b1
  1. 15
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

15
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -33,6 +33,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import java.awt.BorderLayout;
import java.awt.Color;
@ -776,10 +777,16 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
}
int extraX = (int) ((bounds.x + bounds.width + SelectedPopupDialog.OFFSET_X) * designer.getScale());
int extraY = (int) (bounds.y * designer.getScale());
popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY);
popup.updatePane(designer);
popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible());
popup.setRelativeBounds(bounds);
// 放到事件尾部执行
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY);
popup.updatePane(designer);
popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible());
popup.setRelativeBounds(bounds);
}
});
}
/**

Loading…
Cancel
Save