Changeset 5875 for trunk

Show
Ignore:
Timestamp:
11/12/08 09:54:02 (2 months ago)
Author:
artur.signell@…
Message:

Less flicker for captions in Safari

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java

    r5740 r5875  
    1515import com.itmill.toolkit.terminal.gwt.client.ui.Icon; 
    1616 
    17 //TODO Move styles to CSS 
    1817public class ICaption extends HTML { 
    1918 
     
    6059        sinkEvents(ITooltip.TOOLTIP_EVENTS); 
    6160 
    62         DOM.setStyleAttribute(getElement(), "whiteSpace", "nowrap"); 
    63  
    6461    } 
    6562 
     
    8582            if (icon == null) { 
    8683                icon = new Icon(client); 
     84                icon.setWidth("0px"); 
     85                icon.setHeight("0px"); 
    8786 
    8887                DOM.sinkEvents(icon.getElement(), Event.ONLOAD); 
     
    220219        if (DOM.eventGetType(event) == Event.ONLOAD 
    221220                && icon.getElement() == target && !iconOnloadHandled) { 
     221            icon.setWidth(""); 
     222            icon.setHeight(""); 
     223 
    222224            /* 
    223225             * IE6 pngFix causes two onload events to be fired and we want to 
     
    312314    public int getHeight() { 
    313315        int height = clearElement.getOffsetTop() - getElement().getOffsetTop(); 
    314         if (icon != null) { 
    315             int iconHeight = icon.getOffsetHeight(); 
    316             ApplicationConnection.getConsole().log( 
    317                     "Caption height: " + height + ", icon height: " 
    318                             + iconHeight); 
    319         } 
    320  
    321316        return height; 
    322317    }