diff options
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 38f34c77..b59233c7 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -201,7 +201,9 @@ static void updateSideIconBuf_DocumentWidget_ (const iDocumentWidget *d); | |||
201 | static void prerender_DocumentWidget_ (iAny *); | 201 | static void prerender_DocumentWidget_ (iAny *); |
202 | static void scrollBegan_DocumentWidget_ (iAnyObject *, int, uint32_t); | 202 | static void scrollBegan_DocumentWidget_ (iAnyObject *, int, uint32_t); |
203 | 203 | ||
204 | static const int smoothDuration_DocumentWidget_ = 600; /* milliseconds */ | 204 | static const int smoothDuration_DocumentWidget_(enum iScrollType type) { |
205 | return 600 /* milliseconds */ * scrollSpeedFactor_Prefs(prefs_App(), type); | ||
206 | } | ||
205 | 207 | ||
206 | enum iRequestState { | 208 | enum iRequestState { |
207 | blank_RequestState, | 209 | blank_RequestState, |
@@ -2913,7 +2915,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
2913 | const float amount = argLabel_Command(cmd, "full") != 0 ? 1.0f : 0.5f; | 2915 | const float amount = argLabel_Command(cmd, "full") != 0 ? 1.0f : 0.5f; |
2914 | smoothScroll_DocumentWidget_(d, | 2916 | smoothScroll_DocumentWidget_(d, |
2915 | dir * amount * height_Rect(documentBounds_DocumentWidget_(d)), | 2917 | dir * amount * height_Rect(documentBounds_DocumentWidget_(d)), |
2916 | smoothDuration_DocumentWidget_); | 2918 | smoothDuration_DocumentWidget_(keyboard_ScrollType)); |
2917 | return iTrue; | 2919 | return iTrue; |
2918 | } | 2920 | } |
2919 | else if (equal_Command(cmd, "scroll.top") && document_App() == d) { | 2921 | else if (equal_Command(cmd, "scroll.top") && document_App() == d) { |
@@ -2942,7 +2944,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
2942 | } | 2944 | } |
2943 | smoothScroll_DocumentWidget_(d, | 2945 | smoothScroll_DocumentWidget_(d, |
2944 | 3 * lineHeight_Text(paragraph_FontId) * dir, | 2946 | 3 * lineHeight_Text(paragraph_FontId) * dir, |
2945 | smoothDuration_DocumentWidget_); | 2947 | smoothDuration_DocumentWidget_(keyboard_ScrollType)); |
2946 | return iTrue; | 2948 | return iTrue; |
2947 | } | 2949 | } |
2948 | else if (equal_Command(cmd, "document.goto") && document_App() == d) { | 2950 | else if (equal_Command(cmd, "document.goto") && document_App() == d) { |
@@ -3381,7 +3383,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e | |||
3381 | smoothScroll_DocumentWidget_( | 3383 | smoothScroll_DocumentWidget_( |
3382 | d, | 3384 | d, |
3383 | -3 * amount * lineHeight_Text(paragraph_FontId), | 3385 | -3 * amount * lineHeight_Text(paragraph_FontId), |
3384 | smoothDuration_DocumentWidget_ * | 3386 | smoothDuration_DocumentWidget_(mouse_ScrollType) * |
3385 | /* accelerated speed for repeated wheelings */ | 3387 | /* accelerated speed for repeated wheelings */ |
3386 | (!isFinished_SmoothScroll(&d->scrollY) && pos_Anim(&d->scrollY.pos) < 0.25f | 3388 | (!isFinished_SmoothScroll(&d->scrollY) && pos_Anim(&d->scrollY.pos) < 0.25f |
3387 | ? 0.5f | 3389 | ? 0.5f |