summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-21 12:44:05 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-21 12:44:05 +0200
commitd30daab57241b8ec9e72e24b2f600923d6a231c4 (patch)
tree0d75fc1c3e4a5ea072558964e06072453c9eadd1
parent0b2b40a233c014e684f6efed0298efda02e7abf4 (diff)
DocumentWidget: Scroll-loading is only for images
-rw-r--r--src/ui/documentwidget.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 0fc969ba..c3c0f527 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -1239,6 +1239,7 @@ static iBool fetchNextUnfetchedImage_DocumentWidget_(iDocumentWidget *d) {
1239 if (run->linkId && !run->imageId && ~run->flags & decoration_GmRunFlag) { 1239 if (run->linkId && !run->imageId && ~run->flags & decoration_GmRunFlag) {
1240 const int linkFlags = linkFlags_GmDocument(d->doc, run->linkId); 1240 const int linkFlags = linkFlags_GmDocument(d->doc, run->linkId);
1241 if (isMediaLink_GmDocument(d->doc, run->linkId) && 1241 if (isMediaLink_GmDocument(d->doc, run->linkId) &&
1242 linkFlags & imageFileExtension_GmLinkFlag &&
1242 ~linkFlags & content_GmLinkFlag && ~linkFlags & permanent_GmLinkFlag ) { 1243 ~linkFlags & content_GmLinkFlag && ~linkFlags & permanent_GmLinkFlag ) {
1243 if (requestMedia_DocumentWidget_(d, run->linkId)) { 1244 if (requestMedia_DocumentWidget_(d, run->linkId)) {
1244 return iTrue; 1245 return iTrue;
@@ -1587,11 +1588,10 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1587 } 1588 }
1588 else if (equal_Command(cmd, "scroll.page") && document_App() == d) { 1589 else if (equal_Command(cmd, "scroll.page") && document_App() == d) {
1589 const int dir = arg_Command(cmd); 1590 const int dir = arg_Command(cmd);
1590 if (!argLabel_Command(cmd, "repeat") && prefs_App()->loadImageInsteadOfScrolling && 1591 if (dir > 0 && !argLabel_Command(cmd, "repeat") &&
1591 dir > 0) { 1592 prefs_App()->loadImageInsteadOfScrolling &&
1592 if (fetchNextUnfetchedImage_DocumentWidget_(d)) { 1593 fetchNextUnfetchedImage_DocumentWidget_(d)) {
1593 return iTrue; 1594 return iTrue;
1594 }
1595 } 1595 }
1596 smoothScroll_DocumentWidget_(d, 1596 smoothScroll_DocumentWidget_(d,
1597 dir * (0.5f * height_Rect(documentBounds_DocumentWidget_(d)) - 1597 dir * (0.5f * height_Rect(documentBounds_DocumentWidget_(d)) -
@@ -1617,11 +1617,10 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1617 } 1617 }
1618 else if (equal_Command(cmd, "scroll.step") && document_App() == d) { 1618 else if (equal_Command(cmd, "scroll.step") && document_App() == d) {
1619 const int dir = arg_Command(cmd); 1619 const int dir = arg_Command(cmd);
1620 if (!argLabel_Command(cmd, "repeat") && prefs_App()->loadImageInsteadOfScrolling && 1620 if (dir > 0 && !argLabel_Command(cmd, "repeat") &&
1621 dir > 0) { 1621 prefs_App()->loadImageInsteadOfScrolling &&
1622 if (fetchNextUnfetchedImage_DocumentWidget_(d)) { 1622 fetchNextUnfetchedImage_DocumentWidget_(d)) {
1623 return iTrue; 1623 return iTrue;
1624 }
1625 } 1624 }
1626 smoothScroll_DocumentWidget_(d, 1625 smoothScroll_DocumentWidget_(d,
1627 3 * lineHeight_Text(paragraph_FontId) * dir, 1626 3 * lineHeight_Text(paragraph_FontId) * dir,