mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-17 13:02:49 -05:00
Fix adaptive icon painting
This commit is contained in:
parent
2e6c22d44d
commit
c7323accf2
@ -117,16 +117,8 @@ AdaptiveIconEngine::AdaptiveIconEngine(QIcon baseIcon)
|
|||||||
|
|
||||||
void AdaptiveIconEngine::paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state)
|
void AdaptiveIconEngine::paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
|
||||||
double dpr = !kpxcApp->testAttribute(Qt::AA_UseHighDpiPixmaps) ? 1.0 : painter->device()->devicePixelRatioF();
|
|
||||||
#else
|
|
||||||
double dpr = !kpxcApp->testAttribute(Qt::AA_UseHighDpiPixmaps) ? 1.0 : painter->device()->devicePixelRatio();
|
|
||||||
#endif
|
|
||||||
QSize pixmapSize = rect.size() * dpr;
|
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->drawPixmap(rect, m_baseIcon.pixmap(pixmapSize, mode, state));
|
m_baseIcon.paint(painter, rect, Qt::AlignCenter, mode, state);
|
||||||
|
|
||||||
if (getMainWindow()) {
|
if (getMainWindow()) {
|
||||||
QPalette palette = getMainWindow()->palette();
|
QPalette palette = getMainWindow()->palette();
|
||||||
painter->setCompositionMode(QPainter::CompositionMode_SourceAtop);
|
painter->setCompositionMode(QPainter::CompositionMode_SourceAtop);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user