diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-16 12:12:54 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-16 12:12:54 +0000 |
commit | 7271aabb80c0e65caf7271f7c25856b220cfde5d (patch) | |
tree | b8a15ea93b22e2b701f8bce9d86dcd1be3ecbadf | |
parent | c3f59a1a057f692c761004f9bfa5f5f53658481d (diff) | |
download | vaadin-framework-7271aabb80c0e65caf7271f7c25856b220cfde5d.tar.gz vaadin-framework-7271aabb80c0e65caf7271f7c25856b220cfde5d.zip |
absolutelayout now updates relative component sizes properly on size changes
svn changeset:7438/svn branch:6.0
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IAbsoluteLayout.java | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IAbsoluteLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IAbsoluteLayout.java index 2b2def0e7f..8b10854959 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IAbsoluteLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IAbsoluteLayout.java @@ -179,8 +179,20 @@ public class IAbsoluteLayout extends ComplexPanel implements Container { // inside marginals) canvas.getStyle().setProperty("width", width); - if (!rendering && BrowserInfo.get().isIE6()) { - relayoutWrappersForIe6(); + if (!rendering) { + if (BrowserInfo.get().isIE6()) { + relayoutWrappersForIe6(); + } + relayoutRelativeChildren(); + } + } + + private void relayoutRelativeChildren() { + for (Widget widget : getChildren()) { + if (widget instanceof Paintable) { + Paintable new_name = (Paintable) widget; + client.handleComponentRelativeSize(widget); + } } } @@ -191,8 +203,11 @@ public class IAbsoluteLayout extends ComplexPanel implements Container { // inside marginals) canvas.getStyle().setProperty("height", height); - if (!rendering && BrowserInfo.get().isIE6()) { - relayoutWrappersForIe6(); + if (!rendering) { + if (BrowserInfo.get().isIE6()) { + relayoutWrappersForIe6(); + } + relayoutRelativeChildren(); } } @@ -227,7 +242,14 @@ public class IAbsoluteLayout extends ComplexPanel implements Container { if (getWidget() != paintable) { setWidget((Widget) paintable); } - paintable.updateFromUIDL(componentUIDL.getChildUIDL(0), client); + UIDL childUIDL = componentUIDL.getChildUIDL(0); + paintable.updateFromUIDL(childUIDL, client); + if (childUIDL.hasAttribute("cached")) { + // child may need relative size adjustment if wrapper details + // have changed this could be optimized (check if wrapper size + // has changed) + client.handleComponentRelativeSize((Widget) paintable); + } } public void setPosition(String stringAttribute) { |