mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-30 19:36:20 +01:00
Fix bug 1900099: when bools are set to bistate, checking "show checkmarks" results in all non-bool values being shown as false
This commit is contained in:
parent
194924bbb1
commit
b8a2ae8fa5
1 changed files with 15 additions and 5 deletions
|
|
@ -769,11 +769,21 @@ def renderer(field, decorator=False):
|
|||
bn = self.bool_no_icon
|
||||
by = self.bool_yes_icon
|
||||
|
||||
def func(idx):
|
||||
val = force_to_bool(fffunc(field_obj, idfunc(idx)))
|
||||
if val is None:
|
||||
return None if bt else bn
|
||||
return by if val else bn
|
||||
if dt != 'bool':
|
||||
def func(idx):
|
||||
val = fffunc(field_obj, idfunc(idx))
|
||||
if val is None:
|
||||
return None
|
||||
val = force_to_bool(val)
|
||||
if val is None:
|
||||
return None
|
||||
return by if val else bn
|
||||
else:
|
||||
def func(idx):
|
||||
val = force_to_bool(fffunc(field_obj, idfunc(idx)))
|
||||
if val is None:
|
||||
return None if bt else bn
|
||||
return by if val else bn
|
||||
elif field == 'size':
|
||||
sz_mult = 1/(1024**2)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue