summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorWojciech Sudol2013-11-20 03:55:43 (EST)
committer Gerrit Code Review @ Eclipse.org2013-11-20 10:19:21 (EST)
commit24fa07639e8d8ba20176a1e1d1eb36d4b3727f9f (patch)
tree2ee5819999749c793af54aa7bde3a02d94971a42
parentac4976740bf402d3be4c05844678cc4c4da1e935 (diff)
downloadeclipse.platform.ui-24fa07639e8d8ba20176a1e1d1eb36d4b3727f9f.zip
eclipse.platform.ui-24fa07639e8d8ba20176a1e1d1eb36d4b3727f9f.tar.gz
eclipse.platform.ui-24fa07639e8d8ba20176a1e1d1eb36d4b3727f9f.tar.bz2
Bug 417213 - [Perspectives] Sash layout corrupted by dragging into therefs/changes/09/18609/2
editor area Change-Id: I91ecb527460b296885f78b7671ceae53375916e2 Signed-off-by: Wojciech Sudol <wojciech.sudol@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java4
2 files changed, 4 insertions, 8 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java
index 8bbbe70..b278fb4 100644
--- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java
@@ -41,7 +41,6 @@ public class SplitDropAgent extends DropAgent {
private MPartStack dropStack;
private CTabFolder dropCTF;
private Rectangle clientBounds;
- private String weight;
private Rectangle ctfBounds;
@@ -94,7 +93,6 @@ public class SplitDropAgent extends DropAgent {
if (dragParent == dropStack && dropStack.getChildren().size() == 2)
return false;
- weight = dropStack.getContainerData();
dropCTF = (CTabFolder) dropStack.getWidget();
return true;
@@ -370,14 +368,8 @@ public class SplitDropAgent extends DropAgent {
}
float pct = (float) (onEdge ? 0.34 : 0.50);
- MUIElement relToParent = relTo.getParent();
dndManager.getModelService().insert(toInsert, relTo, where, pct);
- // Force the new sash to have the same weight as the original element
- if (relTo.getParent() != relToParent && !onEdge)
- relTo.getParent().setContainerData(weight);
- dndManager.update();
-
return true;
}
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java
index 77dd06a..a3541db 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java
@@ -751,6 +751,10 @@ public class ModelServiceImpl implements EModelService {
} else {
MPartSashContainer newSash = BasicFactoryImpl.eINSTANCE.createPartSashContainer();
newSash.setHorizontal(horizontal);
+
+ // Maintain the existing weight in the new sash
+ newSash.setContainerData(relTo.getContainerData());
+
combine(toInsert, relTo, newSash, insertBefore, ratio);
}