mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Make the list actions toggles
This commit is contained in:
parent
9c5aaade6f
commit
fcb72c0075
@ -338,8 +338,11 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{
|
|||||||
ls = c.currentList()
|
ls = c.currentList()
|
||||||
if ls is not None:
|
if ls is not None:
|
||||||
lf = ls.format()
|
lf = ls.format()
|
||||||
lf.setStyle(fmt)
|
if lf.style() == fmt:
|
||||||
ls.setFormat(lf)
|
c.setBlockFormat(QTextBlockFormat())
|
||||||
|
else:
|
||||||
|
lf.setStyle(fmt)
|
||||||
|
ls.setFormat(lf)
|
||||||
else:
|
else:
|
||||||
ls = c.createList(fmt)
|
ls = c.createList(fmt)
|
||||||
|
|
||||||
@ -1053,6 +1056,6 @@ if __name__ == '__main__':
|
|||||||
w.show()
|
w.show()
|
||||||
w.html = '''<h1>Test Heading</h1><blockquote>Test blockquote</blockquote><p><span style="background-color: rgb(0, 255, 255); ">He hadn't
|
w.html = '''<h1>Test Heading</h1><blockquote>Test blockquote</blockquote><p><span style="background-color: rgb(0, 255, 255); ">He hadn't
|
||||||
set <u>out</u> to have an <em>affair</em>, <span style="font-style:italic; background-color:red">
|
set <u>out</u> to have an <em>affair</em>, <span style="font-style:italic; background-color:red">
|
||||||
much</span> less a <s>long-term</s>, <b>devoted</b> one.</span>'''
|
much</span> less a <s>long-term</s>, <b>devoted</b> one.</span><p>hello'''
|
||||||
app.exec_()
|
app.exec_()
|
||||||
# print w.html
|
# print w.html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user