From 1324d7b519186fced47cc637cc7298a8fbe7a88e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Wed, 21 Mar 2012 13:37:05 +0200 Subject: [PATCH] Ensure AbsoluteLayout wrappers have the rigth size (#8313) --- .../base/absolutelayout/absolutelayout.css | 12 +++++++++++- .../gwt/client/ui/VAbsoluteLayout.java | 19 +++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/WebContent/VAADIN/themes/base/absolutelayout/absolutelayout.css b/WebContent/VAADIN/themes/base/absolutelayout/absolutelayout.css index b2c2ed2858..fba94a8edc 100644 --- a/WebContent/VAADIN/themes/base/absolutelayout/absolutelayout.css +++ b/WebContent/VAADIN/themes/base/absolutelayout/absolutelayout.css @@ -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%; +} diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java index 48c6109f44..88f525cb4e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java @@ -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; -- 2.39.5