From: Leif Åstrand Date: Tue, 14 Feb 2012 10:31:23 +0000 (+0200) Subject: Some small tweaks to the split panels (#8313) X-Git-Tag: 7.0.0.alpha2~434^2~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=acf87e2d323fbb001a7fdfae42982b2f618ff6f5;p=vaadin-framework.git Some small tweaks to the split panels (#8313) --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanel.java index 9a24384f1e..d3ac9b2def 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanel.java @@ -231,10 +231,11 @@ public class VAbstractSplitPanel extends ComplexPanel { // Convert percentage values to pixels if (pos.indexOf("%") > 0) { - pos = Float.parseFloat(pos.substring(0, pos.length() - 1)) - / 100 - * (orientation == ORIENTATION_HORIZONTAL ? getOffsetWidth() - : getOffsetHeight()) + "px"; + int size = orientation == ORIENTATION_HORIZONTAL ? getOffsetWidth() + : getOffsetHeight(); + float percentage = Float.parseFloat(pos.substring(0, + pos.length() - 1)); + pos = percentage / 100 * size + "px"; } String attributeName; @@ -457,6 +458,7 @@ public class VAbstractSplitPanel extends ComplexPanel { } setSplitPosition(newX + "px"); + client.doLayout(false); } private void onVerticalMouseMove(int y) { @@ -500,6 +502,7 @@ public class VAbstractSplitPanel extends ComplexPanel { } setSplitPosition(newY + "px"); + client.doLayout(false); } public void onMouseUp(Event event) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanelPaintable.java b/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanelPaintable.java index 8b21c26960..7f33c0fa28 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanelPaintable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanelPaintable.java @@ -94,8 +94,6 @@ public abstract class VAbstractSplitPanelPaintable extends getWidgetForPaintable().setStylenames(); getWidgetForPaintable().position = uidl.getStringAttribute("position"); - getWidgetForPaintable().setSplitPosition( - getWidgetForPaintable().position); final VPaintableWidget newFirstChildPaintable = client .getPaintable(uidl.getChildUIDL(0));