mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Possible fix for #1630735
This commit is contained in:
parent
6484275560
commit
4eeed37a2e
@ -7,6 +7,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
import re, importlib
|
||||
from collections import deque
|
||||
import textwrap, unicodedata
|
||||
from future_builtins import map
|
||||
|
||||
@ -103,6 +104,7 @@ class TextEdit(PlainTextEdit):
|
||||
self.cursorPositionChanged.connect(self.highlight_cursor_line)
|
||||
self.blockCountChanged[int].connect(self.update_line_number_area_width)
|
||||
self.updateRequest.connect(self.update_line_number_area)
|
||||
self.currently_showing_tooltip_memory = deque(maxlen=10)
|
||||
|
||||
@dynamic_property
|
||||
def is_modified(self):
|
||||
@ -648,9 +650,11 @@ class TextEdit(PlainTextEdit):
|
||||
if fmt is not None:
|
||||
tt = unicode(fmt.toolTip())
|
||||
if tt:
|
||||
tt = textwrap.fill(tt)
|
||||
self.currently_showing_tooltip_memory.append(tt)
|
||||
QToolTip.setFont(self.tooltip_font)
|
||||
QToolTip.setPalette(self.tooltip_palette)
|
||||
QToolTip.showText(ev.globalPos(), textwrap.fill(tt))
|
||||
QToolTip.showText(ev.globalPos(), tt)
|
||||
return
|
||||
QToolTip.hideText()
|
||||
ev.ignore()
|
||||
|
Loading…
x
Reference in New Issue
Block a user