mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ebook viewer: j/k keys scroll by a small amount again
This commit is contained in:
parent
e144a04d7b
commit
f607124d30
@ -541,11 +541,6 @@ class DocumentView(QWebView):
|
|||||||
if self.manager is not None:
|
if self.manager is not None:
|
||||||
self.manager.scrolled(self.scroll_fraction)
|
self.manager.scrolled(self.scroll_fraction)
|
||||||
|
|
||||||
def wheel_event(self, down=True):
|
|
||||||
QWebView.wheelEvent(self,
|
|
||||||
QWheelEvent(QPoint(100, 100), (-120 if down else 120),
|
|
||||||
Qt.NoButton, Qt.NoModifier))
|
|
||||||
|
|
||||||
def next_page(self):
|
def next_page(self):
|
||||||
delta_y = self.document.window_height - 25
|
delta_y = self.document.window_height - 25
|
||||||
if self.document.at_bottom:
|
if self.document.at_bottom:
|
||||||
@ -654,9 +649,9 @@ class DocumentView(QWebView):
|
|||||||
else:
|
else:
|
||||||
self.scroll_to(1)
|
self.scroll_to(1)
|
||||||
elif key in [Qt.Key_J]:
|
elif key in [Qt.Key_J]:
|
||||||
self.wheel_event()
|
self.scroll_by(y=15)
|
||||||
elif key in [Qt.Key_K]:
|
elif key in [Qt.Key_K]:
|
||||||
self.wheel_event(down=False)
|
self.scroll_by(y=-15)
|
||||||
elif key in [Qt.Key_H]:
|
elif key in [Qt.Key_H]:
|
||||||
self.scroll_by(x=-15)
|
self.scroll_by(x=-15)
|
||||||
elif key in [Qt.Key_L]:
|
elif key in [Qt.Key_L]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user