I have a "grid" of different fields in Scout Neon (M5) application.
My problem is that String
and number (BigDecimal
for example) fields has different text position in field.
In String
field, text is positioned on left side, and in BigDecimal
(and other number fields) text is positioned on right side.
I understand why by default this is a case, but in grid layout it really doesn't look good.
How to change text position in fields?
Just set the property horizontalAlignment
to -1
.
public class IntegerField extends AbstractIntegerField {
@Override
protected int getConfiguredHorizontalAlignment() {
return -1;
}
}
It is not obvious though because the javadoc says that this property configures the horizontal alignment of the field inside a group box. This is is true as well, but only if fillHorizontal
is set to false
.
So currently the property is used for 2 purposes:
fillHorizontal
is false