diff options
author | Gonzalo Odiard <godiard@sugarlabs.org> | 2011-05-30 16:28:17 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@sugarlabs.org> | 2011-05-31 13:12:49 (GMT) |
commit | a0cdef436aa2296a631d50b2c483be8cf90c62d3 (patch) | |
tree | 8460197d8b06645073c46dcb8fe46690fbee476e /epubview | |
parent | 1ee3977e1c54a791050e69b2622b42e02cda8698 (diff) |
Fix #10806 - No scrolling in Read
Read had implemented scrolling by page (with page up/down keys),
this patch implement scroll by steps with the keys up/down
in pdf and epub backends.
Diffstat (limited to 'epubview')
-rw-r--r-- | epubview/epubview.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/epubview/epubview.py b/epubview/epubview.py index 5dccad0..b9f157c 100644 --- a/epubview/epubview.py +++ b/epubview/epubview.py @@ -27,7 +27,6 @@ import BeautifulSoup from epub import _Epub from jobs import _JobPaginator as _Paginator - LOADING_HTML = ''' <div style="width:100%;height:100%;text-align:center;padding-top:50%;"> <h1>Loading...</h1> @@ -249,7 +248,8 @@ class _View(gtk.HBox): Scrolls through the pages. Scrolling is horizontal if horizontal is set to True Valid scrolltypes are: - gtk.SCROLL_PAGE_BACKWARD and gtk.SCROLL_PAGE_FORWARD + gtk.SCROLL_PAGE_BACKWARD, gtk.SCROLL_PAGE_FORWARD, + gtk.SCROLL_STEP_BACKWARD and gtk.SCROLL_STEP_FORWARD ''' if scrolltype == gtk.SCROLL_PAGE_BACKWARD: self.__going_back = True @@ -261,6 +261,16 @@ class _View(gtk.HBox): self.__going_fwd = True if not self._do_page_transition(): self._view.move_cursor(gtk.MOVEMENT_PAGES, 1) + elif scrolltype == gtk.SCROLL_STEP_BACKWARD: + self.__going_fwd = False + self.__going_back = True + if not self._do_page_transition(): + self._view.move_cursor(gtk.MOVEMENT_DISPLAY_LINES, -1) + elif scrolltype == gtk.SCROLL_STEP_FORWARD: + self.__going_fwd = True + self.__going_back = False + if not self._do_page_transition(): + self._view.move_cursor(gtk.MOVEMENT_DISPLAY_LINES, 1) else: print ('Got unsupported scrolltype %s' % str(scrolltype)) |