Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/epubadapter.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-04-09 14:55:18 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-04-09 14:55:18 (GMT)
commit31829913fe58cb95017f83a86aecaa05561ba611 (patch)
tree6c952275565abfef23ab5e92019df3258ed1ee09 /epubadapter.py
parenta4d8be9c984c86bf33bba75bd54a6422b341368d (diff)
Save and restore the page with epub files - SL #3413
When the user closed and reopened the activity, reading a epub file, the page was lost. The problem had two sources: The invisible webkit widget used to measure the document height, can add a scrollbar (randomly) then the inner width change, the text folw differently and the inner height change. This problem is solved setting document.documentElement.style.overflow = hidden in the widget when is used to measure. The second problem was, after the document was loaded and positioned the epubview tried to change the scroll position again. This patch include a minor change in readactivity.py, only to avoid call many times view.get_current_page. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'epubadapter.py')
-rw-r--r--epubadapter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/epubadapter.py b/epubadapter.py
index a14ef18..cb6bfc2 100644
--- a/epubadapter.py
+++ b/epubadapter.py
@@ -134,7 +134,7 @@ class EpubViewer(epubview.EpubView):
GObject.timeout_add(200, self._try_load_page, n)
def get_current_page(self):
- return int(self._loaded_page - 1)
+ return int(self._loaded_page) - 1
def update_toc(self, activity):
if self._epub.has_document_links():