mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Comments editor: Dont insert blank lines between list elements
Also remove the extra styling inserted by Qt. Now the spacing between list items is controlled by the stylesheet.
This commit is contained in:
parent
5dce5a527f
commit
8648e3ff2f
@ -196,6 +196,12 @@ def cleanup_qt_markup(root):
|
|||||||
if tag.tag == 'p' and style_map[tag].get('-qt-paragraph-type') == 'empty':
|
if tag.tag == 'p' and style_map[tag].get('-qt-paragraph-type') == 'empty':
|
||||||
del tag[:]
|
del tag[:]
|
||||||
tag.text = '\xa0'
|
tag.text = '\xa0'
|
||||||
|
if tag.tag in ('ol', 'ul'):
|
||||||
|
for li in tag.iterdescendants('li'):
|
||||||
|
ts = style_map.get(li)
|
||||||
|
if ts:
|
||||||
|
remove_margins(li, ts)
|
||||||
|
remove_zero_indents(ts)
|
||||||
for style in itervalues(style_map):
|
for style in itervalues(style_map):
|
||||||
filter_qt_styles(style)
|
filter_qt_styles(style)
|
||||||
for tag, style in iteritems(style_map):
|
for tag, style in iteritems(style_map):
|
||||||
@ -236,7 +242,7 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{
|
|||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
QTextEdit.__init__(self, parent)
|
QTextEdit.__init__(self, parent)
|
||||||
self.setTabChangesFocus(True)
|
self.setTabChangesFocus(True)
|
||||||
self.document().setDefaultStyleSheet(css())
|
self.document().setDefaultStyleSheet(css() + '\n\nli { margin-top: 0.5ex; margin-bottom: 0.5ex; }')
|
||||||
font = self.font()
|
font = self.font()
|
||||||
f = QFontInfo(font)
|
f = QFontInfo(font)
|
||||||
delta = tweaks['change_book_details_font_size_by'] + 1
|
delta = tweaks['change_book_details_font_size_by'] + 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user