aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2009-04-29 09:15:20 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2009-04-29 09:15:20 +0000
commit8b0cf2389f1152f50cb38832f0b1d84b9e5cdbe4 (patch)
tree12620a4abacb962d12fc41bbc1e3a593b6dda271 /src/com/itmill
parentd452ea2fd4a476157e841cce1d232398727c4f18 (diff)
downloadvaadin-framework-8b0cf2389f1152f50cb38832f0b1d84b9e5cdbe4.tar.gz
vaadin-framework-8b0cf2389f1152f50cb38832f0b1d84b9e5cdbe4.zip
iscrolltable fix for scrollbars on size change
svn changeset:7568/svn branch:6.0
Diffstat (limited to 'src/com/itmill')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
index 596b47a191..96d10fa7c3 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
@@ -578,19 +578,7 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
tHead.disableBrowserIntelligence();
- boolean willHaveScrollbarz = false;
- if (!(height != null && !height.equals(""))) {
- if (pageLength < totalRows) {
- willHaveScrollbarz = true;
- }
- } else {
- int fakeheight = tBody.getRowHeight() * totalRows;
- int availableHeight = bodyContainer.getElement().getPropertyInt(
- "clientHeight");
- if (fakeheight > availableHeight) {
- willHaveScrollbarz = true;
- }
- }
+ boolean willHaveScrollbarz = willHaveScrollbars();
// fix "natural" width if width not set
if (width == null || "".equals(width)) {
@@ -731,6 +719,22 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
initializedAndAttached = true;
}
+ private boolean willHaveScrollbars() {
+ if (!(height != null && !height.equals(""))) {
+ if (pageLength < totalRows) {
+ return true;
+ }
+ } else {
+ int fakeheight = tBody.getRowHeight() * totalRows;
+ int availableHeight = bodyContainer.getElement().getPropertyInt(
+ "clientHeight");
+ if (fakeheight > availableHeight) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* This method has logic which rows needs to be requested from server when
* user scrolls
@@ -2708,6 +2712,9 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
// Hey IE, are you really sure about this?
availW = tBody.getAvailableWidth();
availW -= tBody.getCellExtraWidth() * visibleColOrder.length;
+ if (willHaveScrollbars()) {
+ availW -= Util.getNativeScrollbarSize();
+ }
int extraSpace = availW - usedMinimumWidth;
if (extraSpace < 0) {