From: Jouni Koivuviita Date: Tue, 28 Jul 2009 08:56:01 +0000 (+0000) Subject: VButton now updates primary stylename only when it's changes, not every time it is... X-Git-Tag: 6.7.0.beta1~2639 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b719ba97e784ebc2243b540b68b5af9f7005910b;p=vaadin-framework.git VButton now updates primary stylename only when it's changes, not every time it is different from the default. svn changeset:8417/svn branch:6.0 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VButton.java b/src/com/vaadin/terminal/gwt/client/ui/VButton.java index c42c19dc93..768b98727b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VButton.java @@ -28,6 +28,8 @@ public class VButton extends Button implements Paintable { // Used only for IE, because it doesn't support :active CSS selector private static final String CLASSNAME_DOWN = "v-pressed"; + private String primaryStyleName; + String id; ApplicationConnection client; @@ -72,9 +74,11 @@ public class VButton extends Button implements Paintable { public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - // client.updateComponent depends on this, so this must come before that. - if (uidl.hasAttribute("primarystyle")) { - setStyleName(uidl.getStringAttribute("primarystyle")); + // client.updateComponent depends on this, so this must come before + if (uidl.hasAttribute("primarystyle") + && primaryStyleName != uidl.getStringAttribute("primarystyle")) { + primaryStyleName = uidl.getStringAttribute("primarystyle"); + setStyleName(primaryStyleName); captionElement.setPropertyString("className", getStylePrimaryName() + "-caption"); }