[gnome-books/wip/hadess/dont-forget-epub-page] epubview: Fix epub books always opening on page 1



commit 5aeee8e1cb510b59c8015307a291c07b21acd1ac
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.
    
    The default range being between is between 0.0 and 1.0, when the range
    is set after loading the file, a "value-change" signal will be sent.
    This signal will be received and a new "1" value written as the current
    page to disk, before the saved page is read.
    
    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]