summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorEric Moffatt2011-08-10 10:02:35 (EDT)
committer Paul Webster2011-08-25 10:22:00 (EDT)
commitd5e6b7a103e8fb938470fd5bb83d96ee8b0f3b40 (patch)
treeffa4c8aee2eb27c5af7a1cbf7ef8858230ef409e
parent7b8ce64491b8f39de3085c25551c45b3fec4e509 (diff)
downloadeclipse.platform.ui-d5e6b7a103e8fb938470fd5bb83d96ee8b0f3b40.zip
eclipse.platform.ui-d5e6b7a103e8fb938470fd5bb83d96ee8b0f3b40.tar.gz
eclipse.platform.ui-d5e6b7a103e8fb938470fd5bb83d96ee8b0f3b40.tar.bz2
Fix for Bug 350596 - [Compatibility] [breadcrumb] Cannot
activate breadcrumb by re-sizing the Debug view in 4.x (try 2)
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java
index 8e8db27..306cc68 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java
@@ -19,7 +19,9 @@ import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Shell;
public class SashLayout extends Layout {
-
+ // The minimum value (as a percentage) that a sash can be dragged to
+ int minSashPercent = 10;
+
int marginLeft = 0;
int marginRight = 0;
int marginTop = 0;
@@ -159,7 +161,7 @@ public class SashLayout extends Layout {
protected void adjustWeights(List<SashRect> sashes, int curX, int curY) {
for (SashRect sr : sashes) {
int totalWeight = getWeight(sr.left) + getWeight(sr.right);
- int tenPctTotal = totalWeight / 10;
+ int minSashValue = (int) (((totalWeight / 100.0) * minSashPercent) + 0.5);
Rectangle leftRect = getRectangle(sr.left);
Rectangle rightRect = getRectangle(sr.right);
@@ -174,20 +176,20 @@ public class SashLayout extends Layout {
double right = rightRect.x + rightRect.width;
double pct = (curX - left) / (right - left);
leftWeight = (int) ((totalWeight * pct) + 0.5);
- if (leftWeight < tenPctTotal)
- leftWeight = tenPctTotal;
- if (leftWeight > (totalWeight - tenPctTotal))
- leftWeight = totalWeight - tenPctTotal;
+ if (leftWeight < minSashValue)
+ leftWeight = minSashValue;
+ if (leftWeight > (totalWeight - minSashValue))
+ leftWeight = totalWeight - minSashValue;
rightWeight = totalWeight - leftWeight;
} else {
double top = leftRect.y;
double bottom = rightRect.y + rightRect.height;
double pct = (curY - top) / (bottom - top);
leftWeight = (int) ((totalWeight * pct) + 0.5);
- if (leftWeight < tenPctTotal)
- leftWeight = tenPctTotal;
- if (leftWeight > (totalWeight - tenPctTotal))
- leftWeight = totalWeight - tenPctTotal;
+ if (leftWeight < minSashValue)
+ leftWeight = minSashValue;
+ if (leftWeight > (totalWeight - minSashValue))
+ leftWeight = totalWeight - minSashValue;
rightWeight = totalWeight - leftWeight;
}