mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-27 19:52:58 +02:00
Ebook-viewer: scroll by 20%.
This commit is contained in:
parent
def5885cf2
commit
322d5d5ef4
1 changed files with 4 additions and 2 deletions
|
|
@ -511,10 +511,12 @@ def wheelEvent(self, event):
|
|||
return
|
||||
|
||||
ret = QWebView.wheelEvent(self, event)
|
||||
|
||||
scroll_amount = (event.delta() / 120.0) * .2 * -1
|
||||
if event.orientation() == Qt.Vertical:
|
||||
self.scroll_by(0, event.delta() * -1)
|
||||
self.scroll_by(0, self.document.viewportSize().height() * scroll_amount)
|
||||
else:
|
||||
self.scroll_by(event.delta() * -1, 0)
|
||||
self.scroll_by(self.document.viewportSize().width() * scroll_amount, 0)
|
||||
|
||||
if self.manager is not None:
|
||||
self.manager.scrolled(self.scroll_fraction)
|
||||
|
|
|
|||
Loading…
Reference in a new issue