Changeset 4829

Show
Ignore:
Timestamp:
06/10/08 09:26:04 (4 months ago)
Author:
magi@…
Message:

Merged [4811] from trunk to 5.2 branch: Fixed horizontal alignments in AbsoluteGrid? (OrderedLayout? and GridLayout? implementation).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/5.2/src/com/itmill/toolkit/terminal/gwt/client/ui/absolutegrid/AbsoluteGrid.java

    r3923 r4829  
    242242            DOM.setStyleAttribute(getElement(), "textAlign", alignmentInfo 
    243243                    .getHorizontalAlignment()); 
     244            if (getWidget() != null) { 
     245                Element el = getWidget().getElement(); 
     246                if (alignmentInfo.isHorizontalCenter() 
     247                        || alignmentInfo.isRight()) { 
     248                    DOM.setStyleAttribute(el, "marginLeft", "auto"); 
     249                } else { 
     250                    DOM.setStyleAttribute(el, "marginLeft", ""); 
     251                } 
     252                if (alignmentInfo.isHorizontalCenter() 
     253                        || alignmentInfo.isLeft()) { 
     254                    DOM.setStyleAttribute(el, "marginRight", "auto"); 
     255                } else { 
     256                    DOM.setStyleAttribute(el, "marginRight", ""); 
     257                } 
     258            } 
    244259        } 
    245260    }