summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java9
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java18
2 files changed, 18 insertions, 9 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java
index 2c5fadff3b..d08387fc6d 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java
@@ -893,9 +893,10 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
}
private int getDecorationHeight() {
- LayoutManager layoutManager = layout.getLayoutManager();
- return layoutManager.getOuterHeight(getElement())
- - layoutManager.getInnerHeight(contentPanel.getElement());
+ LayoutManager lm = layout.getLayoutManager();
+ int headerHeight = lm.getOuterHeight(header);
+ int footerHeight = lm.getOuterHeight(footer);
+ return headerHeight + footerHeight;
}
public int getMinWidth() {
@@ -905,7 +906,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
private int getDecorationWidth() {
LayoutManager layoutManager = layout.getLayoutManager();
return layoutManager.getOuterWidth(getElement())
- - layoutManager.getInnerWidth(contentPanel.getElement());
+ - contentPanel.getElement().getOffsetWidth();
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java b/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java
index 99910aae8b..85f4213d3e 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java
@@ -46,6 +46,8 @@ public class WindowConnector extends AbstractComponentContainerConnector
private WindowServerRPC rpc;
+ boolean minWidthChecked = false;
+
@Override
public boolean delegateCaptionHandling() {
return false;
@@ -220,11 +222,16 @@ public class WindowConnector extends AbstractComponentContainerConnector
ComponentConnector layout = window.layout;
Element contentElement = window.contentPanel.getElement();
- boolean needsMinWidth = !isUndefinedWidth() || layout.isRelativeWidth();
- int minWidth = window.getMinWidth();
- if (needsMinWidth && lm.getInnerWidth(contentElement) < minWidth) {
- // Use minimum width if less than a certain size
- window.setWidth(minWidth + "px");
+ if (!minWidthChecked) {
+ boolean needsMinWidth = !isUndefinedWidth()
+ || layout.isRelativeWidth();
+ int minWidth = window.getMinWidth();
+ if (needsMinWidth && lm.getInnerWidth(contentElement) < minWidth) {
+ minWidthChecked = true;
+ // Use minimum width if less than a certain size
+ window.setWidth(minWidth + "px");
+ }
+ minWidthChecked = true;
}
boolean needsMinHeight = !isUndefinedHeight()
@@ -274,6 +281,7 @@ public class WindowConnector extends AbstractComponentContainerConnector
}
public void postLayout() {
+ minWidthChecked = false;
VWindow window = getWidget();
if (window.centered) {
window.center();