Improve styling.
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 14 Feb 2021 10:02:55 +0000 (11:02 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 14 Feb 2021 10:02:55 +0000 (11:02 +0100)
core/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultEditionLayer.java
core/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java
core/org.argeo.suite.ui/src/org/argeo/suite/ui/widgets/TabbedArea.java
publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java

index d017ee7d7f5f0a33897bfe66085dd8b289aa1853..68081b4e646d944b9066c855f98cdc941b48f2ff 100644 (file)
@@ -105,9 +105,9 @@ public class DefaultEditionLayer implements SuiteLayer {
        }
 
        public void destroy(BundleContext bundleContext, Map<String, String> properties) {
-               
+
        }
-       
+
        public void setEntryArea(CmsUiProvider entryArea) {
                this.entryArea = entryArea;
        }
@@ -159,7 +159,11 @@ public class DefaultEditionLayer implements SuiteLayer {
                        }
                        if (startMaximized)
                                setMaximizedControl(editorArea);
-                       editorArea.setLayout(new GridLayout());
+                       GridLayout editorAreaLayout = new GridLayout();
+                       editorAreaLayout.verticalSpacing = 0;
+                       editorAreaLayout.marginBottom = 0;
+                       editorAreaLayout.marginHeight = 0;
+                       editorArea.setLayout(editorAreaLayout);
 
                        if (DefaultEditionLayer.this.workArea == null) {
                                tabbedArea = createTabbedArea(editorArea, theme);
index 52a2fd6c0f2894adca62bf7e6042a24c1b80933b..816c65818605761c73d4713d3fda98471ba48806 100644 (file)
@@ -56,7 +56,7 @@ class SuiteUi extends Composite {
 
                footer = new Composite(this, SWT.NONE);
                footer.setLayout(CmsUiUtils.noSpaceGridLayout());
-               CmsUiUtils.style(header, SuiteStyle.header);
+               CmsUiUtils.style(footer, SuiteStyle.footer);
                footer.setLayoutData(CmsUiUtils.fillWidth());
        }
 
index e1cf15451d4b35cf0662070e05166a798001cdb0..8ce5fedb736249fd9581c885f6d740bc224641b8 100644 (file)
@@ -91,7 +91,9 @@ public class TabbedArea extends Composite {
                        title.setLayoutData(CmsUiUtils.fillWidth());
                        title.addSelectionListener((Selected) (e) -> showTab(tabIndex(section.getNode())));
                        Node node = section.getNode();
-                       title.setText(Jcr.getTitle(node));
+                       String titleStr = Jcr.getTitle(node);
+                       // TODO internationalize
+                       title.setText(titleStr);
                        if (!singleTab) {
                                ToolBar toolBar = new ToolBar(sectionHeader, SWT.NONE);
                                ToolItem closeItem = new ToolItem(toolBar, SWT.FLAT);
index 814cfb3415e129dcdc28164e27ad72f03d7f78ed..d886b143bde568b1bc31172023eb0c323a1a6ae5 100644 (file)
@@ -75,6 +75,7 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke
        private boolean showMainTitle = true;
 
        private Integer maxMediaWidth = null;
+       private String defaultSectionStyle;
 
        protected AbstractDbkViewer(Section parent, int style, CmsEditable cmsEditable) {
                super(parent, style, cmsEditable);
@@ -106,6 +107,11 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke
                        CmsUiUtils.clear(section);
                        Node node = section.getNode();
                        TextSection textSection = (TextSection) section;
+                       String style = node.hasProperty(DbkAttr.role.name()) ? node.getProperty(DbkAttr.role.name()).getString()
+                                       : getDefaultSectionStyle();
+                       if (style != null)
+                               CmsUiUtils.style(textSection, style);
+
                        if (node.hasNode(DbkType.title.get())) {
                                boolean showTitle = getMainSection() == section ? showMainTitle : true;
                                if (showTitle) {
@@ -946,6 +952,14 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke
                this.showMainTitle = showMainTitle;
        }
 
+       public String getDefaultSectionStyle() {
+               return defaultSectionStyle;
+       }
+
+       public void setDefaultSectionStyle(String defaultSectionStyle) {
+               this.defaultSectionStyle = defaultSectionStyle;
+       }
+
        // FILE UPLOAD LISTENER
        private class FUL implements FileUploadListener {
                public void uploadProgress(FileUploadEvent event) {