diff options
author | Artur <artur@vaadin.com> | 2017-03-16 11:25:35 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-03-16 11:25:35 +0200 |
commit | 41878d8943db8d9db98cf8e752b3ffba9bb8fd59 (patch) | |
tree | e224bcc532a377ab02317571dc64ca4010cbeb09 /server/src/main/java/com/vaadin/ui/AbstractLayout.java | |
parent | 28a815fb833087c1825365ac9b22c097e6d28ca5 (diff) | |
download | vaadin-framework-41878d8943db8d9db98cf8e752b3ffba9bb8fd59.tar.gz vaadin-framework-41878d8943db8d9db98cf8e752b3ffba9bb8fd59.zip |
Correctly write margin info for FormLayout into design files (#8804)
Fixes #8800
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/AbstractLayout.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractLayout.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractLayout.java b/server/src/main/java/com/vaadin/ui/AbstractLayout.java index fe073eb687..7e62176e7c 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractLayout.java +++ b/server/src/main/java/com/vaadin/ui/AbstractLayout.java @@ -105,10 +105,16 @@ public abstract class AbstractLayout extends AbstractComponentContainer */ protected void writeMargin(Element design, MarginInfo margin, MarginInfo defMargin, DesignContext context) { - if (margin.hasAll() || margin.hasNone()) { + if (defMargin.getBitMask() == margin.getBitMask()) { + // Default, no need to write + } else if (margin.hasNone()) { + // Write "margin='false'" DesignAttributeHandler.writeAttribute("margin", design.attributes(), - margin.hasAll(), defMargin.hasAll(), boolean.class, - context); + false, true, boolean.class, context); + } else if (margin.hasAll()) { + // Write "margin" + DesignAttributeHandler.writeAttribute("margin", design.attributes(), + true, false, boolean.class, context); } else { DesignAttributeHandler.writeAttribute("margin-left", |