From 65b10b856815dd2c08f7ec86e258b4233dd391b5 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 12 Nov 2008 09:54:02 +0000 Subject: [PATCH] Less flicker for captions in Safari svn changeset:5875/svn branch:trunk --- .../toolkit/terminal/gwt/client/ICaption.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java index 1efcf3bf05..55f459ea63 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java @@ -14,7 +14,6 @@ import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Widget; import com.itmill.toolkit.terminal.gwt.client.ui.Icon; -//TODO Move styles to CSS public class ICaption extends HTML { public static final String CLASSNAME = "i-caption"; @@ -59,8 +58,6 @@ public class ICaption extends HTML { setStyleName(CLASSNAME); sinkEvents(ITooltip.TOOLTIP_EVENTS); - DOM.setStyleAttribute(getElement(), "whiteSpace", "nowrap"); - } /** @@ -84,6 +81,8 @@ public class ICaption extends HTML { if (uidl.hasAttribute(ATTRIBUTE_ICON)) { if (icon == null) { icon = new Icon(client); + icon.setWidth("0px"); + icon.setHeight("0px"); DOM.sinkEvents(icon.getElement(), Event.ONLOAD); DOM.insertChild(getElement(), icon.getElement(), @@ -219,6 +218,9 @@ public class ICaption extends HTML { if (DOM.eventGetType(event) == Event.ONLOAD && icon.getElement() == target && !iconOnloadHandled) { + icon.setWidth(""); + icon.setHeight(""); + /* * IE6 pngFix causes two onload events to be fired and we want to * react only to the first one @@ -311,13 +313,6 @@ public class ICaption extends HTML { public int getHeight() { int height = clearElement.getOffsetTop() - getElement().getOffsetTop(); - if (icon != null) { - int iconHeight = icon.getOffsetHeight(); - ApplicationConnection.getConsole().log( - "Caption height: " + height + ", icon height: " - + iconHeight); - } - return height; } -- 2.39.5