}
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() {
private int getDecorationWidth() {
LayoutManager layoutManager = layout.getLayoutManager();
return layoutManager.getOuterWidth(getElement())
- - layoutManager.getInnerWidth(contentPanel.getElement());
+ - contentPanel.getElement().getOffsetWidth();
}
}
private WindowServerRPC rpc;
+ boolean minWidthChecked = false;
+
@Override
public boolean delegateCaptionHandling() {
return false;
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()
}
public void postLayout() {
+ minWidthChecked = false;
VWindow window = getWidget();
if (window.centered) {
window.center();