mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
E-book viewer: Fix dragging to select text with the mouse causing the page to slide sideways in paged mode, if the mouse leaves the text area. Fixes #1464862 [Page slides sideways when selecting text in reader](https://bugs.launchpad.net/calibre/+bug/1464862)
This commit is contained in:
parent
e87b7f8d3d
commit
b48d401ac2
@ -1369,6 +1369,13 @@ class DocumentView(QWebView): # {{{
|
||||
return True
|
||||
return QWebView.event(self, ev)
|
||||
|
||||
def mouseMoveEvent(self, ev):
|
||||
if self.document.in_paged_mode and ev.buttons() & Qt.LeftButton and not self.rect().contains(ev.pos(), True):
|
||||
# Prevent this event from causing WebKit to scroll the viewport
|
||||
# See https://bugs.launchpad.net/bugs/1464862
|
||||
return
|
||||
return QWebView.mouseMoveEvent(self, ev)
|
||||
|
||||
def mouseReleaseEvent(self, ev):
|
||||
r = self.document.mainFrame().hitTestContent(ev.pos())
|
||||
a, url = r.linkElement(), r.linkUrl()
|
||||
|
Loading…
x
Reference in New Issue
Block a user