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 18:43:55 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2011-06-10 20:06:09 (GMT)
commitc4c65cad8e5e327d21a986594c6fc16cdfc28c07 (patch)
tree6066130c58e75754a66e54e7f9848e294a0d22f4
parente0906618fd63558b60425f647158537407906e6e (diff)
PDF scrolls to start and end with the Home End keys
Manuel QuiƱones <manuel.por.aca@gmail.com> with a small change by Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--evinceadapter.py7
-rw-r--r--readactivity.py6
2 files changed, 12 insertions, 1 deletions
diff --git a/evinceadapter.py b/evinceadapter.py
index 3d3350c..863dbd5 100644
--- a/evinceadapter.py
+++ b/evinceadapter.py
@@ -223,7 +223,8 @@ class EvinceViewer():
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_START and gtk.SCROLL_END
'''
_logger.error('scroll: %s', scrolltype)
@@ -235,6 +236,10 @@ class EvinceViewer():
self._scroll_step(False)
elif scrolltype == gtk.SCROLL_STEP_FORWARD:
self._scroll_step(True)
+ elif scrolltype == gtk.SCROLL_START:
+ self.set_current_page(0)
+ elif scrolltype == gtk.SCROLL_END:
+ self.set_current_page(self._document.get_n_pages())
else:
print ('Got unsupported scrolltype %s' % str(scrolltype))
diff --git a/readactivity.py b/readactivity.py
index 926dbf3..553bad7 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -947,6 +947,12 @@ class ReadActivity(activity.Activity):
elif keyname == 'KP_End':
self._view_toolbar.zoom_out()
return True
+ elif keyname == 'Home':
+ self._view.scroll(gtk.SCROLL_START, False)
+ return True
+ elif keyname == 'End':
+ self._view.scroll(gtk.SCROLL_END, False)
+ return True
elif keyname == 'Page_Up' or keyname == 'KP_Page_Up':
self._view.scroll(gtk.SCROLL_PAGE_BACKWARD, False)
return True