From 58c5732531666bb24722cb507607bc55a26a690f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 12 Jan 2012 14:25:07 +0000 Subject: [PATCH] #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 --- src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java | 4 ++++ src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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); } -- 2.39.5