diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-06-24 15:40:59 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-06-24 15:40:59 +0000 |
commit | 7b8e08630f31ff84dfeae546261fc13fb5378438 (patch) | |
tree | bcf9e218c897071f9409c257e9f88696791ca433 /src | |
parent | 6c71b5fcad73d899f745a3e821c940cd854be3dd (diff) | |
download | vaadin-framework-7b8e08630f31ff84dfeae546261fc13fb5378438.tar.gz vaadin-framework-7b8e08630f31ff84dfeae546261fc13fb5378438.zip |
fixes #5124, VWindows now hidden until first time render is completed to center phase
svn changeset:13923/svn branch:6.4
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VWindow.java | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java index 82589f22c9..288f2fe32c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java @@ -148,6 +148,8 @@ public class VWindow extends VOverlay implements Container, ScrollListener { private Element wrapper, wrapper2; + private boolean visibilityChangesDisabled; + public VWindow() { super(false, false, true); // no autohide, not modal, shadow // Different style of shadow for windows @@ -260,6 +262,7 @@ public class VWindow extends VOverlay implements Container, ScrollListener { setVaadinModality(!vaadinModality); } if (!isAttached()) { + setVisible(false); // hide until possible centering show(); } if (uidl.getBooleanAttribute("resizable") != resizable) { @@ -269,9 +272,11 @@ public class VWindow extends VOverlay implements Container, ScrollListener { setDraggable(!uidl.hasAttribute("fixedposition")); } + visibilityChangesDisabled = true; if (client.updateComponent(this, uidl, false)) { return; } + visibilityChangesDisabled = false; immediate = uidl.hasAttribute("immediate"); @@ -349,17 +354,6 @@ public class VWindow extends VOverlay implements Container, ScrollListener { setNaturalWidth(); } - if (!dynamicWidth && !dynamicHeight - && uidl.getBooleanAttribute("center")) { - /* - * Iff size is specified we can center the window at this point. By - * doing it early we can avoid some flickering in some browsers. see - * #5124 - */ - centered = true; - center(); - } - layout.updateFromUIDL(childUidl, client); if (!dynamicHeight && layoutRelativeWidth) { /* @@ -447,8 +441,8 @@ public class VWindow extends VOverlay implements Container, ScrollListener { // don't try to center the window anymore centered = false; } - updateShadowSizeAndPosition(); + setVisible(true); boolean sizeReduced = false; // ensure window is not larger than browser window @@ -488,6 +482,19 @@ public class VWindow extends VOverlay implements Container, ScrollListener { } + @Override + public void setVisible(boolean visible) { + /* + * Visibility with VWindow works differently than with other Paintables + * in Vaadin. Invisible VWindows are not attached to DOM at all. Flag is + * used to avoid visibility call from + * ApplicationConnection.updateComponent(); + */ + if (!visibilityChangesDisabled) { + super.setVisible(visible); + } + } + private void setDraggable(boolean draggable) { if (this.draggable == draggable) { return; |