[Look and Feel and KSplash KCM] Set sourceSize for thumbnail
ClosedPublic

Authored by broulik on Jan 17 2019, 2:14 PM.

Details

Summary

Avoids loading huge screenshots just to show them in a tiny thumbnail.
It's using GridView.cellWidth instead of width to avoid reloading the image as the layouting is done. Everytime sourceSize changes, the image is reloaded.

Test Plan

Saves like 10 MB in both KCMS for me
Verified that the Images are only loaded once upon opening the KCM
Still looks ok, albeit slightly blurrier, as before smooth wasn't set on resizing and now it's done in image reader or so.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jan 17 2019, 2:14 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 17 2019, 2:14 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jan 17 2019, 2:14 PM
davidedmundson added a subscriber: davidedmundson.EditedJan 17 2019, 2:21 PM

Setting sourceSize +++

Only thing:

qquickimagebase.cpp
211: void QQuickImageBase::load() {
258: d->pix.load(qmlEngine(this), loadUrl, d->sourcesize * d->devicePixelRatio, options, d->providerOptions);

If you need to change this here we're working around something.

I put debug in Qt, in qmlscene it works as you'd expect.

In the system settings case QQuickImage thinks the DPR is always 1.

The relevant window is
QQuickWindow(0x55f9aee446d0, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window), title="Offscreen", geometry=336,21 426x592)
with window()->effectiveDevicePixelRatio() == 1

It's a bug in the window embedding.


I have a consistent rule about working round Qt bugs.
I'll allow it if and only if we understand the root cause and have filed a bug or patch upstream and then reference it.

apol added a subscriber: apol.Jan 27 2019, 4:16 AM

(Catching up with e-mail) did this fall through?

davidedmundson accepted this revision.Jun 25 2019, 9:00 AM
This revision is now accepted and ready to land.Jun 25 2019, 9:00 AM
This revision was automatically updated to reflect the committed changes.