From: Artur Signell Date: Thu, 12 Jan 2012 14:25:07 +0000 (+0000) Subject: #8085 Do not calculate a fixed width when enabled or readonly status changes if the... X-Git-Tag: 7.0.0.alpha2~485^2~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=58c5732531666bb24722cb507607bc55a26a690f;p=vaadin-framework.git #8085 Do not calculate a fixed width when enabled or readonly status changes if the width for the component is undefined svn changeset:22610/svn branch:6.7 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java index 08e5328b40..549248aab3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java @@ -225,6 +225,10 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, } if (lastReadOnlyState != readonly || lastEnabledState != isEnabled()) { + // Enabled or readonly state changed. Differences in theming might + // affect the width (for instance if the popup button is hidden) so + // we have to recalculate the width (IF the width of the field is + // fixed) updateWidth(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java index 56cdf05ddb..ee5503376e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java @@ -392,10 +392,10 @@ public class VTextualDate extends VDateField implements Paintable, Field, * automatically adjusted by the browser. */ public void updateWidth() { - if (isUndefinedWidth()) { + if (!needLayout) { return; } - needLayout = true; + fieldExtraWidth = -1; iLayout(true); }