mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Add sample colored text to the list of column coloring rules
This commit is contained in:
parent
c043171f7c
commit
24b1ff3e9b
@ -723,11 +723,15 @@ class RulesModel(QAbstractListModel): # {{{
|
|||||||
|
|
||||||
conditions = [self.condition_to_html(c) for c in rule.conditions]
|
conditions = [self.condition_to_html(c) for c in rule.conditions]
|
||||||
|
|
||||||
|
sample = '' if kind != 'color' else (
|
||||||
|
_('(<span style="color: %s;">sample</span>)') % rule.color)
|
||||||
|
|
||||||
return _('''\
|
return _('''\
|
||||||
<p>Set the <b>%(kind)s</b> of <b>%(col)s</b> to <b>%(color)s</b> if the following
|
<p>Set the <b>%(kind)s</b> of <b>%(col)s</b> to <b>%(color)s</b> %(sample)s
|
||||||
conditions are met:</p>
|
if the following conditions are met:</p>
|
||||||
<ul>%(rule)s</ul>
|
<ul>%(rule)s</ul>
|
||||||
''') % dict(kind=trans_kind, col=col, color=rule.color, rule=''.join(conditions))
|
''') % dict(kind=trans_kind, col=col, color=rule.color,
|
||||||
|
sample=sample, rule=''.join(conditions))
|
||||||
|
|
||||||
def condition_to_html(self, condition):
|
def condition_to_html(self, condition):
|
||||||
col, a, v = condition
|
col, a, v = condition
|
||||||
|
Loading…
x
Reference in New Issue
Block a user