mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle both space and comma separated font size keys
This commit is contained in:
parent
a58b15a0ad
commit
2822ddfd5f
@ -64,7 +64,7 @@ class FontKeyChooser(QDialog, Ui_Dialog):
|
|||||||
@property
|
@property
|
||||||
def fsizes(self):
|
def fsizes(self):
|
||||||
key = unicode(self.font_size_key.text()).strip()
|
key = unicode(self.font_size_key.text()).strip()
|
||||||
return [float(x.strip()) for x in key.split(',') if x.strip()]
|
return [float(x.strip()) for x in key.split(',' if ',' in key else ' ') if x.strip()]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dbase(self):
|
def dbase(self):
|
||||||
|
@ -76,6 +76,10 @@ class LookAndFeelWidget(Widget, Ui_Form):
|
|||||||
ans = ans.union(set([x.strip().lower() for x in
|
ans = ans.union(set([x.strip().lower() for x in
|
||||||
unicode(self.filter_css_others.text()).split(',')]))
|
unicode(self.filter_css_others.text()).split(',')]))
|
||||||
return ','.join(ans) if ans else None
|
return ','.join(ans) if ans else None
|
||||||
|
if g is self.opt_font_size_mapping:
|
||||||
|
val = unicode(g.text()).strip()
|
||||||
|
val = [x.strip() for x in val.split(',' if ',' in val else ' ') if x.strip()]
|
||||||
|
return ', '.join(val) or None
|
||||||
return Widget.get_value_handler(self, g)
|
return Widget.get_value_handler(self, g)
|
||||||
|
|
||||||
def set_value_handler(self, g, val):
|
def set_value_handler(self, g, val):
|
||||||
@ -87,7 +91,8 @@ class LookAndFeelWidget(Widget, Ui_Form):
|
|||||||
break
|
break
|
||||||
return True
|
return True
|
||||||
if g is self.opt_filter_css:
|
if g is self.opt_filter_css:
|
||||||
if not val: val = ''
|
if not val:
|
||||||
|
val = ''
|
||||||
items = frozenset([x.strip().lower() for x in val.split(',')])
|
items = frozenset([x.strip().lower() for x in val.split(',')])
|
||||||
for key, vals in self.FILTER_CSS.iteritems():
|
for key, vals in self.FILTER_CSS.iteritems():
|
||||||
w = getattr(self, 'filter_css_%s'%key)
|
w = getattr(self, 'filter_css_%s'%key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user