Information Panel : adapt preview for HiDPI
AbandonedPublic

Authored by meven on Apr 20 2020, 6:22 AM.

Details

Reviewers
ngraham
elvisangelaccio
Group Reviewers
Dolphin
Summary

PreviewJob is not DPR aware, so scale up the preview asked.

BUG: 390488

Test Plan

Before:

After:

Diff Detail

Repository
R318 Dolphin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25493
Build 25511: arc lint + arc unit
meven created this revision.Apr 20 2020, 6:22 AM
Restricted Application added a project: Dolphin. · View Herald TranscriptApr 20 2020, 6:22 AM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
meven requested review of this revision.Apr 20 2020, 6:22 AM
meven edited the test plan for this revision. (Show Details)Apr 20 2020, 6:24 AM

This is more shocking of videos.

Split of D26901

When the size is smaller than KIconLoader::SizeEnormous it prevents to see a size difference between the preview size of a folder and the icon of a folder.
With D29002 the two always match in size.

ngraham accepted this revision.Apr 20 2020, 5:36 PM

Looks like this fixes https://bugs.kde.org/show_bug.cgi?id=408455!

Probably a candidate for the stable branch.

This revision is now accepted and ready to land.Apr 20 2020, 5:36 PM

Probably this patch fixes bug 390488.

elvisangelaccio accepted this revision.Apr 20 2020, 10:47 PM
elvisangelaccio added a subscriber: elvisangelaccio.

Please amend the commit message with whatever bug report(s) this fixes :)

meven edited the summary of this revision. (Show Details)Apr 21 2020, 7:09 AM

It does not, this one is about the main files view.
But the fix will be quite similar.

Probably a candidate for the stable branch.

@elvisangelaccio
?

Please amend the commit message with whatever bug report(s) this fixes :)

Sure, done

Do we have a KF6 task for this to add support for dpr to this? Adding it to the PreviewJob should be straightforward, but we cannot really change the preview plug-ins class.

It does not, this one is about the main files view.
But the fix will be quite similar.

This approach is wrong though, for the main files view in particular. There's a difference between loading e.g. a 32px icon, and a 16px @2x scaling.
Doesn't really matter for the preview pane's large icon size but for the icon view it could have undesired side effects of using a non-symbolic icon when it should by symbolic, or having an icon with too small detail

meven added a comment.Apr 22 2020, 7:21 AM

It does not, this one is about the main files view.
But the fix will be quite similar.

This approach is wrong though, for the main files view in particular. There's a difference between loading e.g. a 32px icon, and a 16px @2x scaling.
Doesn't really matter for the preview pane's large icon size but for the icon view it could have undesired side effects of using a non-symbolic icon when it should by symbolic, or having an icon with too small detail

Do you recommend me to abandon this then ?

Do we have a KF6 task for this to add support for dpr to this? Adding it to the PreviewJob should be straightforward, but we cannot really change the preview plug-ins class.

I have tried to implement to add a setDevicePixelRatio to PreviewJob and in turn add it to the thumbnail ioslave and ThumbCreator.
I don't think we have to wait for KF6 for it, it won't break anything or at least we can implement it in a retro-compatible way.
But this requires some work.

Do you recommend me to abandon this then ?

I think in this particular instance is fine, but could lead to small text for text preview?

it won't break anything or at least we can implement it in a retro-compatible way.

If you have an idea how, sure. You can't add new virtuals to ThumbCreator class, though. Not too keen on having a V2, though.

meven added a comment.Apr 23 2020, 6:48 AM

Do you recommend me to abandon this then ?

I think in this particular instance is fine, but could lead to small text for text preview?

it won't break anything or at least we can implement it in a retro-compatible way.

If you have an idea how, sure. You can't add new virtuals to ThumbCreator class, though. Not too keen on having a V2, though.

I was thinking modifying the virtual bool create(const QString &path, int width, int height, QImage &img) adding it a devicePixelRatio qreal parameter.
I am not sure it will break this way.
So that may we need a KF6 task indeed.

meven planned changes to this revision.May 4 2020, 6:53 AM

I have a working branch of kio and kio-extras allowing to set a device Pixel Ratio.
It needs to solve the binary compatibility issue still around ThumbCreator API
kio patch: D29397

meven abandoned this revision.May 8 2020, 11:19 AM

Replaced by D29525