-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix adaptive icon painting #5989
Conversation
I wonder why the previous implementation didn't work. It does pretty much the same as the upstream code: https://code.woboq.org/qt5/qtbase/src/gui/image/qicon.cpp.html#_ZL31qt_effective_device_pixel_ratioP7QWindow |
Icons looks very sharp. It still does not fix the paperclip and clock icon showing up as filled in blocks on the entry list. |
I went on to investigate what is going on and here are some preliminarily results: 1.)
4.) setting render hint Additional note: Drawing icon via
|
That's what I suspected. Qt itself queries dpr from the window, not the painter. How sharp it looks exactly is probably to do with whether you are scaling in full integer increments or in arbitrary floats. |
I should had read the docs more carefully because it clearly states that if
But using this solution renders ugly icons in |
Btw there is a small bug on line DatabaseOpenWidget.cpp#L74 and DatabaseOpenWidget.cpp#L76. Calling |
Yes, pixmaps are larger than requested when scaling is on, which is exactly the behaviour I was going after with the original implementation. Be careful with what is scaled where. I believe when pixmap scaling is off, they are still being scaled when drawn, but with NN scaling, which looks crisp. With pixmap scaling on, you can get smoother icons, but if they are not the right size, they will still be interpolated and look fuzzy instead. |
This PR fixes adaptive icon being drawn incorrectly on Windows. The change was introduced in PR #5851.
See 5851 for more info.
Note: Fix was tested only on Windows, if it causes problems on other platform I'll scope it to Windows platform only.
Type of change