Allow negative value in search widget for issue262
This commit is contained in:
1 parent
5777bab1a5
commit
fa77be2752
2 files changed
+4
No files matched your search
@@ -45,6 +45,8 @@ class Float(Integer):
|
||||
position = widget.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]:
|
||||
widget.stop_emission('insert-text')
|
||||
except:
|
||||
|
||||
@@ -77,6 +77,8 @@ class Integer(Interface):
|
||||
position = widget.get_position()
|
||||
new_value = value[:position] + new_text + value[position:]
|
||||
try:
|
||||
if new_value == '-':
|
||||
return
|
||||
locale.atoi(new_value)
|
||||
except:
|
||||
widget.stop_emission('insert-text')
|
||||
Reference in new issue
Block a user