Browse Source

REPORT-53130 避免组件配置面板界面在点击当前组件的时候被重置到属性面板

feature/10.0
kuangshuai 3 years ago
parent
commit
845ade7207
  1. 5
      designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java
  2. 6
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

5
designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java

@ -30,6 +30,7 @@ import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import java.awt.LayoutManager;
import java.awt.Rectangle;
@ -83,7 +84,9 @@ public class SelectionModel {
XCreator comp = designer.getComponentAt(e);
if (e.getButton() == MouseEvent.BUTTON3 || (!InputEventBaseOnOS.isControlDown(e) && !e.isShiftDown())) {
// 如果Ctrl或者Shift键盘没有按下,则清除已经选择的组件
selection.reset();
if (!StringUtils.equals(selection.getSelectedCreator().toData().getWidgetName(), comp.toData().getWidgetName())) {
selection.reset();
}
} else {
//按下Ctrl或者shift键时鼠标可以进行多选,两次点击同一控件就取消选中
XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(comp).getTopLayout();

6
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -68,6 +68,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.third.javax.annotation.Nullable;
@ -1476,7 +1477,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
editingMouseListener.stopEditing();
editingMouseListener.stopEditTopLayout(comp);
editingMouseListener.getSelectionModel().reset();
if (!StringUtils.equals(editingMouseListener.getSelectionModel().getSelection().getSelectedCreator().toData().getWidgetName(), comp.toData().getWidgetName())) {
editingMouseListener.getSelectionModel().reset();
}
editingMouseListener.getSelectionModel().selectACreator(comp);
}

Loading…
Cancel
Save