mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show note dialog: Fix links not being activated when clicked
This commit is contained in:
parent
31611e434a
commit
f4db41bf82
@ -24,6 +24,10 @@ class Display(HTMLDisplay):
|
|||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.document().setDefaultStyleSheet(resolved_css() + '\n\nli { margin-top: 0.5ex; margin-bottom: 0.5ex; }')
|
self.document().setDefaultStyleSheet(resolved_css() + '\n\nli { margin-top: 0.5ex; margin-bottom: 0.5ex; }')
|
||||||
self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||||
|
self.anchor_clicked.connect(self.handle_link_click)
|
||||||
|
|
||||||
|
def handle_link_click(self, qurl):
|
||||||
|
safe_open_url(qurl)
|
||||||
|
|
||||||
def loadResource(self, rtype, qurl):
|
def loadResource(self, rtype, qurl):
|
||||||
if qurl.scheme() == RESOURCE_URL_SCHEME and int(rtype) == int(QTextDocument.ResourceType.ImageResource):
|
if qurl.scheme() == RESOURCE_URL_SCHEME and int(rtype) == int(QTextDocument.ResourceType.ImageResource):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user