aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/terminal/gwt
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-05-04 08:56:54 +0000
committerArtur Signell <artur.signell@itmill.com>2009-05-04 08:56:54 +0000
commit7334a8f060de0bd1fde66344783ff3ed365a55d1 (patch)
treeb2b942903764469e4c7c8b38c4dcc75f9977bff9 /src/com/itmill/toolkit/terminal/gwt
parent2fdf5dd7e6d627c90f6941e5d5fd31d1f8e4a27e (diff)
downloadvaadin-framework-7334a8f060de0bd1fde66344783ff3ed365a55d1.tar.gz
vaadin-framework-7334a8f060de0bd1fde66344783ff3ed365a55d1.zip
Fix for #2880 - IE7: Tabsheet caption texts too short when using icons
svn changeset:7608/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit/terminal/gwt')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ICaption.java4
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java23
2 files changed, 27 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java
index d3e12769ad..f83bd035bb 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java
@@ -436,4 +436,8 @@ public class ICaption extends HTML {
}
}
+ protected Element getTextElement() {
+ return captionText;
+ }
+
}
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java
index 519ec6034a..e40b6ac0a8 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java
@@ -45,6 +45,29 @@ public class ITabsheet extends ITabsheetBase {
}
}
+ @Override
+ public void setWidth(String width) {
+ super.setWidth(width);
+ if (BrowserInfo.get().isIE7()) {
+ /*
+ * IE7 apparently has problems with calculating width for
+ * floated elements inside a DIV with padding. Set the width
+ * explicitly for the caption.
+ */
+ fixTextWidth();
+ }
+ }
+
+ private void fixTextWidth() {
+ Element captionText = getTextElement();
+ int captionWidth = Util.getRequiredWidth(captionText);
+ int scrollWidth = captionText.getScrollWidth();
+ if (scrollWidth > captionWidth) {
+ captionWidth = scrollWidth;
+ }
+ captionText.getStyle().setPropertyPx("width", captionWidth);
+ }
+
}
class TabBar extends ComplexPanel implements ClickListener {