Limit entry width to a maximum of 120 chars
This avoids creating horizontal scroll with fields with bigger size. issue10285 review361661002
This commit is contained in:
1 parent
3607669c9f
commit
d4bc450a0c
1 file changed
+4
-2
@@ -55,7 +55,8 @@ class Char(Widget, TranslateMixin, PopdownMixin):
|
||||
entry.set_property('activates_default', True)
|
||||
if self.record:
|
||||
field_size = self.record.expr_eval(self.attrs.get('size'))
|
||||
entry.set_width_chars(field_size or self.default_width_chars)
|
||||
entry.set_width_chars(
|
||||
min(120, field_size or self.default_width_chars))
|
||||
entry.set_max_length(field_size or 0)
|
||||
return entry
|
||||
|
||||
@@ -120,7 +121,8 @@ class Char(Widget, TranslateMixin, PopdownMixin):
|
||||
size_entry = self.entry
|
||||
if self.record:
|
||||
field_size = self.record.expr_eval(self.attrs.get('size'))
|
||||
size_entry.set_width_chars(field_size or self.default_width_chars)
|
||||
size_entry.set_width_chars(
|
||||
min(120, field_size or self.default_width_chars))
|
||||
size_entry.set_max_length(field_size or 0)
|
||||
else:
|
||||
size_entry.set_width_chars(self.default_width_chars)
|
||||
|
||||
Reference in new issue
Block a user