From: Artur Signell Date: Tue, 2 Dec 2008 14:26:24 +0000 (+0000) Subject: Fix for #2270 - TabSheet content height X-Git-Tag: 6.7.0.beta1~3671 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9201b470bcc5d91b8edfc60b03dc0877f5eb9d6e;p=vaadin-framework.git Fix for #2270 - TabSheet content height svn changeset:6072/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java index 7972fa6034..f78c2ca638 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java @@ -309,6 +309,12 @@ public class ITabsheet extends ITabsheetBase { updateDynamicWidth(); } + if (!isDynamicHeight()) { + // Must update height after the styles have been set + updateContentNodeHeight(); + updateOpenTabSize(); + } + iLayout(); // Re run relative size update to ensure optimal scrollbars @@ -450,10 +456,21 @@ public class ITabsheet extends ITabsheetBase { public void setHeight(String height) { super.setHeight(height); this.height = height; + updateContentNodeHeight(); + + if (!rendering) { + updateOpenTabSize(); + iLayout(); + // TODO Check if this is needed + client.runDescendentsLayout(this); + } + } + + private void updateContentNodeHeight() { if (height != null && !"".equals(height)) { - int contentHeight = getOffsetHeight() - - DOM.getElementPropertyInt(deco, "offsetHeight") - - tb.getOffsetHeight() - 5; + int contentHeight = getOffsetHeight(); + contentHeight -= DOM.getElementPropertyInt(deco, "offsetHeight"); + contentHeight -= tb.getOffsetHeight(); if (contentHeight < 0) { contentHeight = 0; } @@ -465,12 +482,6 @@ public class ITabsheet extends ITabsheetBase { DOM.setStyleAttribute(contentNode, "height", ""); renderSpace.setHeight(0); } - if (!rendering) { - updateOpenTabSize(); - iLayout(); - // TODO Check if this is needed - client.runDescendentsLayout(this); - } } @Override