Improve UX
[lgpl/argeo-commons.git] / swt / org.argeo.cms.swt / src / org / argeo / cms / swt / acr / SwtSection.java
index 57c4da00ce0ea502442080051655c779d8d41d48..f4f5961ca7c22530907c36800c5821a2a64ee587 100644 (file)
@@ -27,10 +27,14 @@ public class SwtSection extends ContentComposite {
                this(section, section, style, node);
        }
 
+       public SwtSection(SwtSection section, int style) {
+               this(section, style, null);
+       }
+
        protected SwtSection(Composite parent, SwtSection parentSection, int style, Content node) {
                super(parent, style, node);
                this.parentSection = parentSection;
-               if (parentSection != null) {
+               if (parentSection != null && hasContent() && parentSection.hasContent()) {
                        relativeDepth = getProvidedContent().getDepth() - parentSection.getProvidedContent().getDepth();
                } else {
                        relativeDepth = 0;