mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-31 17:36:16 +01:00
Make CTRL-space clear numeric custom fields in metadata edit
This commit is contained in:
parent
e63e7cca43
commit
d972b64770
1 changed files with 3 additions and 2 deletions
|
|
@ -20,6 +20,7 @@
|
|||
from calibre.utils.config import tweaks
|
||||
from calibre.utils.icu import sort_key
|
||||
from calibre.library.comments import comments_to_html
|
||||
from calibre.gui2.library.delegates import ClearingDoubleSpinBox, ClearingSpinBox
|
||||
|
||||
class Base(object):
|
||||
|
||||
|
|
@ -91,7 +92,7 @@ class Int(Base):
|
|||
|
||||
def setup_ui(self, parent):
|
||||
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
|
||||
QSpinBox(parent)]
|
||||
ClearingSpinBox(parent)]
|
||||
w = self.widgets[1]
|
||||
w.setRange(-1000000, 100000000)
|
||||
w.setSpecialValueText(_('Undefined'))
|
||||
|
|
@ -114,7 +115,7 @@ class Float(Int):
|
|||
|
||||
def setup_ui(self, parent):
|
||||
self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent),
|
||||
QDoubleSpinBox(parent)]
|
||||
ClearingDoubleSpinBox(parent)]
|
||||
w = self.widgets[1]
|
||||
w.setRange(-1000000., float(100000000))
|
||||
w.setDecimals(2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue