Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2011-06-10 19:02:24 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2011-06-10 20:06:28 (GMT)
commit08a4078bd8a046d3492872c286f3ad9d0051aa1b (patch)
tree44f9f8a852072d9389ae1fb5cad7da3ee1ce21da
parent8555bb5ed9bc294d781e2071e87b82e555148773 (diff)
Home/End keys for going to start and end of document in epub adapter
Signed-off-by: Manuel QuiƱones <manuel.por.aca@gmail.com> Acked-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--epubview/epubview.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/epubview/epubview.py b/epubview/epubview.py
index 432c332..c4b3df0 100644
--- a/epubview/epubview.py
+++ b/epubview/epubview.py
@@ -249,7 +249,8 @@ class _View(gtk.HBox):
Scrolling is horizontal if horizontal is set to True
Valid scrolltypes are:
gtk.SCROLL_PAGE_BACKWARD, gtk.SCROLL_PAGE_FORWARD,
- gtk.SCROLL_STEP_BACKWARD and gtk.SCROLL_STEP_FORWARD
+ gtk.SCROLL_STEP_BACKWARD, gtk.SCROLL_STEP_FORWARD
+ gtk.SCROLL_STEP_START and gtk.SCROLL_STEP_STOP
'''
if scrolltype == gtk.SCROLL_PAGE_BACKWARD:
self.__going_back = True
@@ -271,6 +272,16 @@ class _View(gtk.HBox):
self.__going_back = False
if not self._do_page_transition():
self._view.move_cursor(gtk.MOVEMENT_DISPLAY_LINES, 1)
+ elif scrolltype == gtk.SCROLL_START:
+ self.__going_back = True
+ self.__going_fwd = False
+ if not self._do_page_transition():
+ self.set_current_page(1)
+ elif scrolltype == gtk.SCROLL_END:
+ self.__going_back = False
+ self.__going_fwd = True
+ if not self._do_page_transition():
+ self.set_current_page(self._pagecount - 1)
else:
print ('Got unsupported scrolltype %s' % str(scrolltype))