Commit 317d2d44 authored by IBBoard's avatar IBBoard Committed by Bastien Nocera
Browse files

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
parent 5054f3b3
Pipeline #65721 passed with stage
in 9 minutes and 22 seconds
......@@ -259,6 +259,7 @@ const EPUBViewNavControls = new Lang.Class({
this._level.set_increments(1.0, 1.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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment