mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-06 00:13:19 +02:00
Limit the amount of highlighted text displayed in the highlights panel
This commit is contained in:
parent
1fcd002121
commit
d90e866e9b
1 changed files with 3 additions and 0 deletions
|
|
@ -116,6 +116,9 @@ def load(self, highlights):
|
|||
highlights = (h for h in highlights if not h.get('removed') and h.get('highlighted_text'))
|
||||
for h in self.sorted_highlights(highlights):
|
||||
txt = h.get('highlighted_text')
|
||||
txt = txt.replace('\n', ' ')
|
||||
if len(txt) > 100:
|
||||
txt = txt[:100] + '…'
|
||||
i = QListWidgetItem(txt, self)
|
||||
i.setData(Qt.UserRole, h)
|
||||
self.uuid_map[h['uuid']] = self.count() - 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue