Article viewer: Zoom has to be applied after page starts to load
ClosedPublic

Authored by thomasbrixlarsen on Apr 22 2018, 5:43 PM.

Details

Summary

Arch Linux package updates articles are currently being rendered without zoom.

I have tested moving the call to setZoomFactor to later QWebEnginePage signals to find the optimal place to put it.

loadFinished: Renders zoomed, but only after the article is fully loaded.
loadStarted: Renders without zoom.
loadProgress: Renders zoomed.

This patch implements the loadProgress option.

Diff Detail

Repository
R201 Akregator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a subscriber: KDE PIM. · View Herald TranscriptApr 22 2018, 5:43 PM
thomasbrixlarsen requested review of this revision.Apr 22 2018, 5:43 PM

You could wrap it in a check if the current zoom actually differs from Settings::zoom, this way the zoom should only get set once and QtWebEngine will hopefully honor it for the rest of the loading/rendering. Briefly checking the QtWebEngine code reveals that any call to setZoomFactor() triggers something inside the engine, so the fewer times we do it the better :)

thomasbrixlarsen edited the summary of this revision. (Show Details)

Implemented. I have seen the call to setZoomFactor be made at 0, 70, and 100% progress. Worst case from a short test was two calls to setZoomFactor.

mlaurent requested changes to this revision.Apr 24 2018, 4:51 AM
mlaurent added a subscriber: mlaurent.
mlaurent added inline comments.
src/articleviewer-ng/webengine/articleviewerwebenginepage.cpp
74

static_cast<double>(...)

This revision now requires changes to proceed.Apr 24 2018, 4:51 AM

Updated to use static_cast instead of C-style cast.

thomasbrixlarsen marked an inline comment as done.Apr 24 2018, 3:38 PM
mlaurent accepted this revision.Apr 25 2018, 5:49 AM
This revision is now accepted and ready to land.Apr 25 2018, 5:49 AM
This revision was automatically updated to reflect the committed changes.