Fix dynamic size for translate widget
Dynamic size was added in changeset 8ee7e142c8fd but the translate widget was not updated. review3271004 (transplanted from 1a9e84ba4d48a8e2ca2a98680e2bff1c66aa7791)
This commit is contained in:
1 parent
96d2024b10
commit
9cf5e60731
1 file changed
+4
-2
@@ -49,8 +49,10 @@ class Char(WidgetInterface, TranslateMixin):
|
||||
def translate_widget(self):
|
||||
entry = gtk.Entry()
|
||||
entry.set_property('activates_default', True)
|
||||
entry.set_width_chars(int(self.attrs.get('size', -1)))
|
||||
entry.set_max_length(int(self.attrs.get('size', 0)))
|
||||
if self.record:
|
||||
field_size = self.record.expr_eval(self.attrs.get('size'))
|
||||
entry.set_width_chars(field_size or -1)
|
||||
entry.set_max_length(field_size or 0)
|
||||
return entry
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in new issue
Block a user