From 37f772de6abdb6aafb85d426d532fc5fe83f2e23 Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Tue, 18 Aug 2015 21:46:39 +0300 Subject: Cut off Grid cell content when max column width is set (#18617) Change-Id: I912377ffe366e6ac46280b374fa04caa59c3bcf2 --- client/src/com/vaadin/client/widgets/Grid.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 369e530b9d..d7b31efd14 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -2799,8 +2799,9 @@ public class Grid extends ResizeComposite implements for (Column column : nonFixedColumns) { final int expandRatio = (defaultExpandRatios ? 1 : column .getExpandRatio()); - final double newWidth = column.getWidthActual(); final double maxWidth = getMaxWidth(column); + final double newWidth = Math.min(maxWidth, + column.getWidthActual()); boolean shouldExpand = newWidth < maxWidth && expandRatio > 0 && column != selectionColumn; if (shouldExpand) { @@ -2819,6 +2820,7 @@ public class Grid extends ResizeComposite implements double pixelsToDistribute = escalator.getInnerWidth() - reservedPixels; if (pixelsToDistribute <= 0 || totalRatios <= 0) { + setColumnSizes(columnSizes); return; } -- cgit v1.2.3