]> source.dussan.org Git - vaadin-framework.git/commitdiff
Some small tweaks to the split panels (#8313)
authorLeif Åstrand <leif@vaadin.com>
Tue, 14 Feb 2012 10:31:23 +0000 (12:31 +0200)
committerLeif Åstrand <leif@vaadin.com>
Tue, 14 Feb 2012 10:31:23 +0000 (12:31 +0200)
src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanel.java
src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanelPaintable.java

index 9a24384f1e3bc86c1a9bcffe7c2109591dc7447b..d3ac9b2defbec25e626d10b483778231ad0023d5 100644 (file)
@@ -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) {
index 8b21c26960a80548be2f22aefb13b3fb4d2a5cb4..7f33c0fa287e54ace094f5700e7080af5655131a 100644 (file)
@@ -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));