From 9201b470bcc5d91b8edfc60b03dc0877f5eb9d6e Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 2 Dec 2008 14:26:24 +0000 Subject: [PATCH] Fix for #2270 - TabSheet content height svn changeset:6072/svn branch:trunk --- .../terminal/gwt/client/ui/ITabsheet.java | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) 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 -- 2.39.5