Allow to enter '-' in float, interger field
This commit is contained in:
1 parent
2b697f4abf
commit
67d0473a9a
2 files changed
+4
No files matched your search
@@ -30,6 +30,8 @@ class Float(Integer):
|
||||
position = entry.get_position()
|
||||
new_value = value[:position] + new_text + value[position:]
|
||||
try:
|
||||
if new_value == '-':
|
||||
return
|
||||
if len(str(int(locale.atof(new_value)))) > self.digits[0]:
|
||||
entry.stop_emission('insert-text')
|
||||
except:
|
||||
|
||||
@@ -31,6 +31,8 @@ class Integer(Char):
|
||||
position = entry.get_position()
|
||||
new_value = value[:position] + new_text + value[position:]
|
||||
try:
|
||||
if new_value == '-':
|
||||
return
|
||||
locale.atoi(new_value)
|
||||
except:
|
||||
entry.stop_emission('insert-text')
|
||||
Reference in new issue
Block a user