Browse Source

Ensure AbsoluteLayout wrappers have the rigth size (#8313)

tags/7.0.0.alpha2
Leif Åstrand 12 years ago
parent
commit
1324d7b519

+ 11
- 1
WebContent/VAADIN/themes/base/absolutelayout/absolutelayout.css View File

@@ -1,4 +1,14 @@
.v-absolutelayout-wrapper {
position: absolute;
overflow: hidden;
}
}
.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%;
}

+ 3
- 16
src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java View 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;

Loading…
Cancel
Save