[gnome-books/wip/hadess/dont-forget-epub-page] epubview: Fix epub books always opening on page 1
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-books/wip/hadess/dont-forget-epub-page] epubview: Fix epub books always opening on page 1
- Date: Wed, 6 Mar 2019 11:07:41 +0000 (UTC)
commit 317d2d441b0b5e7dae99fc505448f646639ede04
Author: IBBoard <dev ibboard co uk>
Date: Mon Mar 4 20:29:08 2019 +0000
epubview: Fix epub books always opening on page 1
The page/chapter read count is not honored for epubs and the ebook is
reopened on the first page instead.
The epub view's slider's range is set to be between 1.0 and X where X is
the number of pages in the document, after the document has been loaded,
but that range is between 0.0 and 1.0 by default.
After the epub has been loaded, the navigation bar is created, and the
"value-changed" signal that will save the current page connected.
As the epub document is "set" for the bar, the range is first changed to
match the number of pages in the document, changing the range, thus
changing the "current page", overwriting the saved page, then the page
is restored.
(Note that the on-disk page number is 0-indexed, as is the "chapter"
libgepub property)
Closes: #11
src/epubview.js | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/src/epubview.js b/src/epubview.js
index 5000ff6d..b90aaf6f 100644
--- a/src/epubview.js
+++ b/src/epubview.js
@@ -259,6 +259,7 @@ const EPUBViewNavControls = new Lang.Class({
this._level.set_increments(1.0, 1.0);
this._level.set_draw_value(false);
this._level.set_digits(0);
+ this._level.set_range(1.0, 1.0);
barWidget.pack_start(this._level, true, true, 5);
this._level.connect('value-changed', Lang.bind(this, function() {
if (this._epubdoc != null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]