E-book viewer: Allow the up and down keys to scroll past section boundaries

This commit is contained in:
Kovid Goyal 2012-03-28 10:58:02 +05:30
parent 164a116098
commit 23739e7dec

View File

@ -982,8 +982,12 @@ class DocumentView(QWebView): # {{{
finally: finally:
self.is_auto_repeat_event = False self.is_auto_repeat_event = False
elif key == 'Down': elif key == 'Down':
if self.document.at_bottom:
self.manager.next_document()
self.scroll_by(y=15) self.scroll_by(y=15)
elif key == 'Up': elif key == 'Up':
if self.document.at_top:
self.manager.previous_document()
self.scroll_by(y=-15) self.scroll_by(y=-15)
elif key == 'Left': elif key == 'Left':
self.scroll_by(x=-15) self.scroll_by(x=-15)