Adjust the centering shift based on the device scale factor.
Also enable HiDPI icons.
BUG: 394308
davidedmundson |
KDE Applications |
Adjust the centering shift based on the device scale factor.
Also enable HiDPI icons.
BUG: 394308
Only tested with "QT_SCALE_FACTOR=x.x kmag"
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
kmagzoomview.cpp | ||
---|---|---|
330 | It can be const. |
kmagzoomview.cpp | ||
---|---|---|
331 | You're getting the logical width of m_coloredPixmap from it's pixel size, so you should be using the devicePixelRatio of m_coloredPixmap and not the devicePixelRatio of the current paint device. They're probably the same, you shouldn't cound on it. (Also consider looking at style()->drawItemPixmap it's a convenient wrapper around centering a pixmap in a rect, which looks to be what this code is trying to do) |
kmagzoomview.cpp | ||
---|---|---|
331 | s/cound/count |
Regarding using QStyle::drawItemPixmap(): that won't work, because I need to scale the painter to draw the pixmap scaled. Centering in this case needs the additional transformations.