]> source.dussan.org Git - vaadin-framework.git/commitdiff
Ensure AbsoluteLayout wrappers have the rigth size (#8313)
authorLeif Åstrand <leif@vaadin.com>
Wed, 21 Mar 2012 11:37:05 +0000 (13:37 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 21 Mar 2012 11:37:05 +0000 (13:37 +0200)
WebContent/VAADIN/themes/base/absolutelayout/absolutelayout.css
src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java

index b2c2ed28589945aee87254957483dabcb428da84..fba94a8edccbf72e0a4b43ca4bd84302ff3738f3 100644 (file)
@@ -1,4 +1,14 @@
 .v-absolutelayout-wrapper {
        position: absolute;
        overflow: hidden;
-}
\ No newline at end of file
+}
+.v-absolutelayout-margin, .v-absolutelayout-canvas {
+       box-sizing: border-box;
+       -moz-box-sizing: border-box;
+}
+.v-absolutelayout.v-has-height > div, .v-absolutelayout.v-has-height > div > div {
+       height: 100%;
+}
+.v-absolutelayout.v-has-width > div, .v-absolutelayout.v-has-width > div > div {
+       width: 100%;
+}
index 48c6109f4480b3b558b222c02ccd71be8b6a5b51..88f525cb4e3796c1e113c2295ce8f48a071f62b3 100644 (file)
@@ -47,6 +47,9 @@ public class VAbsoluteLayout extends ComplexPanel {
         canvas.getStyle().setProperty("overflow", "hidden");
         marginElement.appendChild(canvas);
         getElement().appendChild(marginElement);
+
+        canvas.setClassName(CLASSNAME + "-canvas");
+        canvas.setClassName(CLASSNAME + "-margin");
     }
 
     AbsoluteWrapper getWrapper(ApplicationConnection client, UIDL componentUIDL) {
@@ -66,22 +69,6 @@ public class VAbsoluteLayout extends ComplexPanel {
         super.add(child, canvas);
     }
 
-    @Override
-    public void setWidth(String width) {
-        super.setWidth(width);
-        // TODO do this so that canvas gets the sized properly (the area
-        // inside marginals)
-        canvas.getStyle().setProperty("width", width);
-    }
-
-    @Override
-    public void setHeight(String height) {
-        super.setHeight(height);
-        // TODO do this so that canvas gets the sized properly (the area
-        // inside marginals)
-        canvas.getStyle().setProperty("height", height);
-    }
-
     public class AbsoluteWrapper extends SimplePanel {
         private String css;
         String left;