]> source.dussan.org Git - vaadin-framework.git/commitdiff
Things now align better in SimpleTree, for #12058
authorMarc Englund <marc@vaadin.com>
Fri, 14 Jun 2013 13:44:46 +0000 (16:44 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 26 Jun 2013 07:30:14 +0000 (07:30 +0000)
Change-Id: Ie36f51b8b6e28aaf0055772a6cf4dcd35b716a3a

client/src/com/vaadin/client/SimpleTree.java

index 289f05022ac88cb787ce45438ee121c8a53d8448..7370496cb8ee7942fe086ee90ee4b4232e4413b1 100644 (file)
@@ -21,6 +21,7 @@ import com.google.gwt.dom.client.SpanElement;
 import com.google.gwt.dom.client.Style;
 import com.google.gwt.dom.client.Style.Cursor;
 import com.google.gwt.dom.client.Style.Display;
+import com.google.gwt.dom.client.Style.TextAlign;
 import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
@@ -54,9 +55,10 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers {
         style.setProperty("whiteSpace", "nowrap");
         style.setPadding(3, Unit.PX);
         style.setPaddingLeft(12, Unit.PX);
-
+        // handle styling
         style = handle.getStyle();
         style.setDisplay(Display.NONE);
+        style.setTextAlign(TextAlign.CENTER);
         style.setWidth(0.5, Unit.EM);
         style.setHeight(0.5, Unit.EM);
         style.setCursor(Cursor.POINTER);
@@ -68,8 +70,9 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers {
         handle.setInnerHTML("+");
         getElement().appendChild(handle);
         getElement().appendChild(text);
+        // children styling
         style = children.getStyle();
-        style.setPaddingLeft(9, Unit.PX);
+        style.setPaddingLeft(1.5, Unit.EM);
         style.setDisplay(Display.NONE);
 
         getElement().appendChild(children);