aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-12-07 16:59:08 +0000
committerArtur Signell <artur.signell@itmill.com>2010-12-07 16:59:08 +0000
commitfaf7a0597fd41d14708a5a4beece0184f24e0156 (patch)
treeac24302eb419576a88ed5aecffa63811a6215a37
parentede903d48329523a07dff5b820dfba410ae18e05 (diff)
downloadvaadin-framework-faf7a0597fd41d14708a5a4beece0184f24e0156.tar.gz
vaadin-framework-faf7a0597fd41d14708a5a4beece0184f24e0156.zip
Fixed another IE6 related width bug where the second select drops below the first one because of incorrect width calculations (#2942).
svn changeset:16381/svn branch:6.5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java
index ce3fd24e4c..de01ef6270 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java
@@ -450,14 +450,18 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
private void setInternalWidths() {
DOM.setStyleAttribute(getElement(), "position", "relative");
- // TODO: Should really take borders/padding/margin into account.
- // Compensating for now with a guess.
- int buttonsExtraWidth = Util.measureHorizontalPaddingAndBorder(
+ int bordersAndPaddings = Util.measureHorizontalPaddingAndBorder(
buttons.getElement(), 0);
- int buttonWidth = Util.getRequiredWidth(buttons) + buttonsExtraWidth;
+
+ if (BrowserInfo.get().isIE6()) {
+ // IE6 sets a border on selects by default..
+ bordersAndPaddings += 4;
+ }
+
+ int buttonWidth = Util.getRequiredWidth(buttons);
int totalWidth = getOffsetWidth();
- int spaceForSelect = (totalWidth - buttonWidth) / 2;
+ int spaceForSelect = (totalWidth - buttonWidth - bordersAndPaddings) / 2;
options.setWidth(spaceForSelect + "px");
if (optionsCaption != null) {