Adapt form page viewer to dynamic ergonomy
authorBruno Sinou <bsinou@argeo.org>
Mon, 9 Nov 2015 20:33:32 +0000 (20:33 +0000)
committerBruno Sinou <bsinou@argeo.org>
Mon, 9 Nov 2015 20:33:32 +0000 (20:33 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@8564 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.cms/src/org/argeo/cms/forms/FormPageViewer.java

index 7eddbbc2e6e38aed8f1afaaf20edc419fed31c40..71853461bd99f7ab17ac887e4bd48810b78e3471 100644 (file)
@@ -381,10 +381,13 @@ public class FormPageViewer extends AbstractPageViewer {
        }
 
        protected Label createPropertyLbl(Composite parent, String value, int vAlign) {
-               Label label = new Label(parent, SWT.RIGHT | SWT.WRAP);
+               boolean isSmall = CmsUtils.getCmsView().getUxContext().isSmall();
+               Label label = new Label(parent, isSmall ? SWT.LEFT : SWT.RIGHT
+                               | SWT.WRAP);
                label.setText(value + " ");
                CmsUtils.style(label, FormStyle.propertyLabel.style());
-               GridData gd = new GridData(SWT.RIGHT, vAlign, false, false);
+               GridData gd = new GridData(isSmall ? SWT.LEFT : SWT.RIGHT, vAlign,
+                               false, false);
                gd.widthHint = labelColWidth;
                label.setLayoutData(gd);
                return label;