diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-12-07 12:12:14 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-12-07 12:12:14 +0000 |
commit | fd3fa691278afbf4ad3797824d4d7f4c491eec48 (patch) | |
tree | a08d950d8bc8501a9d2ed1a1aa09a0cee86d4eb7 /src/com | |
parent | b76d5386b0e0ee8188f1094ec49edbef9e9edd7b (diff) | |
download | vaadin-framework-fd3fa691278afbf4ad3797824d4d7f4c491eec48.tar.gz vaadin-framework-fd3fa691278afbf4ad3797824d4d7f4c491eec48.zip |
#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
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java | 6 |
1 files 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;
|