Browse Source

REPORT-84407 修改隐藏面板时组件的宽度、高度

newui
Leo.Qin 2 years ago
parent
commit
947e420b83
  1. 11
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

11
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -58,6 +58,9 @@ import java.util.Set;
public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> { public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20);
// 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3
protected static final Dimension HIDDEN_LABEL_DIMENSION = new Dimension(0, -3);
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3;
/** /**
@ -67,7 +70,6 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private static final int CONTENT_PANE_WIDTH_GAP = 3; private static final int CONTENT_PANE_WIDTH_GAP = 3;
private static final int MOUSE_WHEEL_SPEED = 5; private static final int MOUSE_WHEEL_SPEED = 5;
private static final int SCROLLBAR_WIDTH = 7; private static final int SCROLLBAR_WIDTH = 7;
private final int HTML_SHIFT_HEIGHT = -3;
private UILabel cellLabel; private UILabel cellLabel;
private int maxHeight = 280; private int maxHeight = 280;
@ -286,11 +288,10 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
if (selectedOneCell) { if (selectedOneCell) {
columnRowTextField.setPreferredSize(null); columnRowTextField.setPreferredSize(null);
cellLabel.setPreferredSize(null); cellLabel.setPreferredSize(null);
// 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3 multipleLabelTip.setPreferredSize(HIDDEN_LABEL_DIMENSION);
multipleLabelTip.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT));
} else { } else {
columnRowTextField.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); columnRowTextField.setPreferredSize(HIDDEN_LABEL_DIMENSION);
cellLabel.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); cellLabel.setPreferredSize(HIDDEN_LABEL_DIMENSION);
multipleLabelTip.setPreferredSize(null); multipleLabelTip.setPreferredSize(null);
} }
} }

Loading…
Cancel
Save