Browse Source

REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效

【问题原因】需要在中间版本发布,提一份到final
【改动思路】改动已经在release中通过,提一份到final
final/10.0
Yvan 4 years ago
parent
commit
f0edaca906
  1. 16
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

16
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -45,6 +45,7 @@ public class UIResizableContainer extends JPanel {
private boolean isLeftRightDragEnabled = true; private boolean isLeftRightDragEnabled = true;
private boolean isDownPaneVisible = true ; private boolean isDownPaneVisible = true ;
private int paraHeight; private int paraHeight;
private int parentHeight = -1;
public UIResizableContainer(int direction) { public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction); this(new JPanel(), new JPanel(), direction);
@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel {
if (verticalToolPane == null || downPane == null) { if (verticalToolPane == null || downPane == null) {
return; return;
} }
// REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY
adjustToolPaneY(parent);
if (direction == Constants.RIGHT) { if (direction == Constants.RIGHT) {
if(isDownPaneVisible){ if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);
@ -236,6 +238,18 @@ public class UIResizableContainer extends JPanel {
} }
} }
private void adjustToolPaneY(Container parent) {
if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight();
}
if (parentHeight != parent.getHeight() && (parent.getHeight() - toolPaneHeight) >= 0) {
// 调整toolPaneY,保证至少水平的拖拽条horizontToolPane不丢失
toolPaneY = Math.min(toolPaneY, parent.getHeight() - toolPaneHeight);
parentHeight = parent.getHeight();
}
}
@Override @Override
public void addLayoutComponent(String name, Component comp) { public void addLayoutComponent(String name, Component comp) {
} }

Loading…
Cancel
Save