mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
63030d807e
@ -613,6 +613,20 @@ class HTMLDisplay(QTextBrowser):
|
|||||||
else:
|
else:
|
||||||
return QTextBrowser.loadResource(self, rtype, qurl)
|
return QTextBrowser.loadResource(self, rtype, qurl)
|
||||||
|
|
||||||
|
def anchorAt(self, pos):
|
||||||
|
# Anchors in a document can be "focused" with the tab key.
|
||||||
|
# Unfortunately, the focus point that Qt provides when using the context
|
||||||
|
# menu key can be 1 pixel out of the anchor's focus rectangle. We
|
||||||
|
# correct for that here by checking if there is an anchor under the
|
||||||
|
# point, moving the point a pixel one direction then the other if there
|
||||||
|
# isn't. This process also slightly dejitters the mouse FWIW.
|
||||||
|
url = super().anchorAt(pos)
|
||||||
|
if not url:
|
||||||
|
url = super().anchorAt(QPoint(pos.x()-1, pos.y()-1))
|
||||||
|
if not url:
|
||||||
|
url = super().anchorAt(QPoint(pos.x()+1, pos.y()+1))
|
||||||
|
return url
|
||||||
|
|
||||||
|
|
||||||
class ScrollingTabWidget(QTabWidget):
|
class ScrollingTabWidget(QTabWidget):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user