Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 7644fd3

Browse files
SORMAS-Foundation#3547 - Adjusted margins and spacings
1 parent 7f912ea commit 7644fd3

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/messaging/SmsComponent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public SmsComponent(long missingPhoneNumbers) {
2929
protected Component initContent() {
3030
final VerticalLayout mainLayout = new VerticalLayout();
3131
mainLayout.setSpacing(false);
32+
mainLayout.setMargin(false);
3233
mainLayout.setSizeUndefined();
3334
mainLayout.setWidth(100, Unit.PERCENTAGE);
3435

@@ -48,7 +49,7 @@ protected Component initContent() {
4849
smsTextArea = new TextArea();
4950
smsTextArea.setWidth(100, Unit.PERCENTAGE);
5051
smsTextArea.setRows(4);
51-
mainLayout.addComponent(tTextFieldWithMaxLengthWrapper.wrap(smsTextArea, Captions.Messages_characters));
52+
mainLayout.addComponent(tTextFieldWithMaxLengthWrapper.wrap(smsTextArea, Captions.Messages_characters, false));
5253

5354
final Label numberOfMessagesLabel = new Label(String.format(I18nProperties.getCaption(Captions.Messages_numberOfMessages), 0));
5455
numberOfMessagesLabel.addStyleNames(CssStyles.ALIGN_RIGHT, CssStyles.FIELD_EXTRA_INFO, CssStyles.LABEL_ITALIC);

sormas-ui/src/main/java/de/symeda/sormas/ui/utils/FieldWrapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222

2323
public interface FieldWrapper<T extends Component> {
2424

25+
ComponentContainer wrap(T component, String caption, boolean withMargin);
26+
2527
ComponentContainer wrap(T component, String caption);
28+
2629
}

sormas-ui/src/main/java/de/symeda/sormas/ui/utils/TextFieldWithMaxLengthWrapper.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ public class TextFieldWithMaxLengthWrapper<T extends AbstractTextField> implemen
3535
private static final int MIN_ROWS = 4;
3636

3737
@Override
38-
public ComponentContainer wrap(T textField, String caption) {
38+
public ComponentContainer wrap(T textField, String caption, boolean withMargin) {
3939

4040
VerticalLayout layout = new VerticalLayout();
4141
layout.setSpacing(false);
4242
layout.setMargin(false);
4343
layout.setWidth(100, Sizeable.Unit.PERCENTAGE);
44-
layout.addStyleName(CssStyles.FIELD_WRAPPER);
44+
if (withMargin) {
45+
layout.addStyleName(CssStyles.FIELD_WRAPPER);
46+
}
4547

4648
textField.setWidth(100, Sizeable.Unit.PERCENTAGE);
4749
textField.addStyleName(CssStyles.RESIZABLE);
@@ -75,6 +77,12 @@ public ComponentContainer wrap(T textField, String caption) {
7577
return layout;
7678
}
7779

80+
@Override
81+
public ComponentContainer wrap(T textField, String caption) {
82+
83+
return wrap(textField, caption, true);
84+
}
85+
7886
private String buildLabelMessage(String text, T textField, String caption) {
7987
return String.format(I18nProperties.getCaption(caption), Strings.nullToEmpty(text).length(), textField.getMaxLength());
8088
}

0 commit comments

Comments
 (0)