mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-30 22:25:23 +01: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
1 changed files with 7 additions and 1 deletions
|
|
@ -196,6 +196,12 @@ def cleanup_qt_markup(root):
|
|||
if tag.tag == 'p' and style_map[tag].get('-qt-paragraph-type') == 'empty':
|
||||
del tag[:]
|
||||
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):
|
||||
filter_qt_styles(style)
|
||||
for tag, style in iteritems(style_map):
|
||||
|
|
@ -236,7 +242,7 @@ def editing_cursor(self, set_cursor=True):
|
|||
def __init__(self, parent=None):
|
||||
QTextEdit.__init__(self, parent)
|
||||
self.setTabChangesFocus(True)
|
||||
self.document().setDefaultStyleSheet(css())
|
||||
self.document().setDefaultStyleSheet(css() + '\n\nli { margin-top: 0.5ex; margin-bottom: 0.5ex; }')
|
||||
font = self.font()
|
||||
f = QFontInfo(font)
|
||||
delta = tweaks['change_book_details_font_size_by'] + 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue