Apply smooth paging patch. New version 0.4.7.
authorAkos Polster <akos@pipacs.com>
Mon, 14 Feb 2011 20:43:56 +0000 (21:43 +0100)
committerAkos Polster <akos@pipacs.com>
Mon, 14 Feb 2011 20:43:56 +0000 (21:43 +0100)
bookview.cpp
dorian.pro
pkg/acknowledgements.txt
pkg/changelog
pkg/version.txt

index 96b9b6e..1e80aa1 100644 (file)
@@ -235,7 +235,6 @@ void BookView::goToFragment(const QString &fragment)
         QVariant ret = page()->mainFrame()->evaluateJavaScript(
                 QString("window.location='") + fragment + "'");
         qDebug() << ret;
-        // FIXME: setLastBookmark();
     }
 }
 
@@ -521,8 +520,8 @@ void BookView::hideEvent(QHideEvent *e)
 void BookView::goPreviousPage()
 {
     QWebFrame *frame = page()->mainFrame();
-    int pos = frame->scrollPosition().y();
-    frame->scroll(0, -(height() - 19));
+    const int pos = frame->scrollPosition().y();
+    frame->scroll(0, -1);
     if (pos == frame->scrollPosition().y()) {
         if (contentIndex > 0) {
             Book::Bookmark bookmark(contentIndex - 1, 1.0);
@@ -531,6 +530,15 @@ void BookView::goPreviousPage()
         }
     } else {
         showProgress();
+        QPropertyAnimation *slide =
+                new QPropertyAnimation(frame, "scrollPosition");
+        const QPoint *offset = new QPoint(0, height() - 18);
+        slide->setDuration(400);
+        slide->setStartValue(frame->scrollPosition());
+        slide->setEndValue(frame->scrollPosition() - *offset);
+        slide->setEasingCurve(QEasingCurve::OutQuad);
+        slide->start(QAbstractAnimation::DeleteWhenStopped);
+        delete offset;
     }
 }
 
@@ -538,12 +546,21 @@ void BookView::goNextPage()
 {
     TRACE;
     QWebFrame *frame = page()->mainFrame();
-    int pos = frame->scrollPosition().y();
-    frame->scroll(0, height() - 19);
+    const int pos = frame->scrollPosition().y();
+    frame->scroll(0, 1);
     if (pos == frame->scrollPosition().y()) {
         goNext();
     } else {
         showProgress();
+        QPropertyAnimation *slide =
+                new QPropertyAnimation(frame, "scrollPosition");
+        const QPoint *offset = new QPoint(0, (height() - 18));
+        slide->setDuration(400);
+        slide->setStartValue(frame->scrollPosition());
+        slide->setEndValue(frame->scrollPosition() + *offset);
+        slide->setEasingCurve(QEasingCurve::OutQuad);
+        slide->start(QAbstractAnimation::DeleteWhenStopped);
+        delete offset;
     }
 }
 
index 0023a8b..61c8384 100644 (file)
@@ -145,7 +145,7 @@ symbian {
 
     # FIXME: Package header for Qt 4.6.2:
     packageheader = \
-        "$${LITERAL_HASH}{\"Dorian\"},(0xA89FC85B),0,4,6" \
+        "$${LITERAL_HASH}{\"Dorian\"},(0xA89FC85B),0,4,7" \
         "[0x101F7961],0,0,0,{\"S60ProductID\"}" \
         "[0x102032BE],0,0,0,{\"S60ProductID\"}" \
         "[0x102752AE],0,0,0,{\"S60ProductID\"}" \
@@ -153,7 +153,7 @@ symbian {
     default_deployment.pkg_prerules = packageheader
 
     # FIXME: Package header for Qt 4.6.3 or later:
-    # packageheader = "$${LITERAL_HASH}{\"Dorian\"},(0xA89FC85B),0,4,6"
+    # packageheader = "$${LITERAL_HASH}{\"Dorian\"},(0xA89FC85B),0,4,7"
     # my_deployment.pkg_prerules = packageheader
     # DEPLOYMENT += my_deployment
 
index ca23dce..c30806e 100644 (file)
@@ -23,3 +23,6 @@ His Sayings: The Folk-Lore of the Old Plantation, by Joel Chandler Harris.
 Illustrations by Frederick S. Church and James H. Moser. New York: D. Appleton
 and Company, 1881. The cover image is in the public domain in the United
 States: http://commons.wikimedia.org/wiki/File:Brer_Rabbit_cover,_1881.jpg.
+
+Smooth paging patch by Felix Braun <Felix.Braun@mail.McGill.ca>, released
+under the GNU GPL version 3.
index d634b91..0716974 100644 (file)
@@ -1,3 +1,9 @@
+dorian (0.4.7-1) unstable; urgency=low
+
+  * Introduce smooth paging
+
+ -- Akos Polster <akos@pipacs.com>  Mon, 14 Feb 2011 02:00:00 +0100
+
 dorian (0.4.6-1) unstable; urgency=low
 
   * Update splash image on Maemo
index 01c70a3..56e6ff8 100644 (file)
@@ -1 +1 @@
-"0.4.6"
+"0.4.7"