From fd3fa691278afbf4ad3797824d4d7f4c491eec48 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 7 Dec 2010 12:12:14 +0000 Subject: [PATCH] #2942 - Dual captions for TwinColSelect Measure instead of guess padding and border to get the right caption correctly aligned svn changeset:16355/svn branch:6.5 --- src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java index 4d74181011..8bee09e9ac 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java @@ -452,9 +452,9 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, DOM.setStyleAttribute(getElement(), "position", "relative"); // TODO: Should really take borders/padding/margin into account. // Compensating for now with a guess. - int buttonsExtraWidthGuess = 4; - int buttonWidth = Util.getRequiredWidth(buttons) - + buttonsExtraWidthGuess; + int buttonsExtraWidth = Util.measureHorizontalPaddingAndBorder( + buttons.getElement(), 0); + int buttonWidth = Util.getRequiredWidth(buttons) + +buttonsExtraWidth; int totalWidth = getOffsetWidth(); int spaceForSelect = (totalWidth - buttonWidth) / 2; -- 2.39.5