]> source.dussan.org Git - vaadin-framework.git/commitdiff
Minor change to how the primary stylename gets applied to the widgets
authorJohn Ahlroos <john@vaadin.com>
Wed, 26 Sep 2012 06:47:35 +0000 (09:47 +0300)
committerJohn Ahlroos <john@vaadin.com>
Wed, 26 Sep 2012 06:47:35 +0000 (09:47 +0300)
#9724

client/src/com/vaadin/client/ui/AbstractComponentConnector.java

index 339bcc9a4611f5a8fc757f4868153c10cdc61c75..26133204e259cb91804b857c021d00d5046b1606 100644 (file)
@@ -72,8 +72,6 @@ public abstract class AbstractComponentConnector extends AbstractConnector
 
         getConnection().getVTooltip().connectHandlersToWidget(getWidget());
 
-        // Set the core 'v' style name for the widget
-        getWidget().setStyleName(StyleConstants.UI_WIDGET, true);
     }
 
     /**
@@ -275,11 +273,14 @@ public abstract class AbstractComponentConnector extends AbstractConnector
         if (state.primaryStyleName != null) {
             /*
              * We overwrite the widgets primary stylename if state defines a
-             * primary stylename
+             * primary stylename. Clears all previous stylenames.
              */
-            getWidget().setStylePrimaryName(state.primaryStyleName);
+            getWidget().setStyleName(state.primaryStyleName);
         }
 
+        // Set the core 'v' style name for the widget
+        setWidgetStyleName(StyleConstants.UI_WIDGET, true);
+
         // should be in AbstractFieldConnector ?
         // add / remove read-only style name
         setWidgetStyleName("v-readonly", isReadOnly());