Fix hidpi issues with ShowImageWidget and MessageDelegateHelperImage
ClosedPublic

Authored by mwolff on May 6 2020, 8:46 PM.

Details

Summary

Set the DPR value of the corresponding widget on the pixmap and
scale the sizes manually. This ensures we don't get blurry pixmaps.

Additionally ensure we don't resize the pixmap in ShowImageWidget
more than needed. We should only scale when we zoom.

Diff Detail

Repository
R865 Ruqola
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mwolff requested review of this revision.May 6 2020, 8:46 PM
mwolff created this revision.
mwolff added a comment.May 6 2020, 8:48 PM

after:

before:

dfaure added a comment.May 6 2020, 9:19 PM

Nice. Did you test animated gifs, given that there were some specific code paths?

you are right, that part has regressed. I'll look into that later

mwolff updated this revision to Diff 82831.May 14 2020, 11:41 AM

fix issues with animated gifs

mwolff updated this revision to Diff 82832.May 14 2020, 11:42 AM

remove unintended change, I hate arc/phabricator

here's how it looks like with animated gifs now, the delegate is nice and sharp but the dialog is blocky but functional. QMovie lacks a DPR-setter, so there's no way for us to fix the dialog afaik, unless we do what the delegate does (extract frames on by one)

mwolff updated this revision to Diff 82840.May 14 2020, 12:58 PM

fix test

dfaure accepted this revision.May 15 2020, 7:56 AM

Thanks!

This revision is now accepted and ready to land.May 15 2020, 7:56 AM
This revision was automatically updated to reflect the committed changes.

@mwolff showimagewidgettest seems to be failing because of this change (if I revert it the test passes):

********* Start testing of ShowImageWidgetTest *********
Config: Using QtTest library 5.14.2, Qt 5.14.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.5.0)
PASS   : ShowImageWidgetTest::initTestCase()
XPASS  : ShowImageWidgetTest::shouldHaveDefaultValues() QCOMPARE(mLabel->pixmap()->size(), pixmapSize) returned TRUE unexpectedly.
   Loc: [/home/shantanu/dev/kde/ruqola/src/widgets/dialogs/autotests/showimagewidgettest.cpp(63)]
PASS   : ShowImageWidgetTest::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 24ms
********* Finished testing of ShowImageWidgetTest *********