forked from qt-creator/qt-creator
Icons: Additionally add lower resolutions to QIcons in HighDPI mode
The lower resolution(s) are needed in setups where attached Displays have different scale factors and Qt Creator is dragged to the lower resolution screens. Task-number: QTCREATORBUG-16128 Change-Id: I20a2e67e4ac5929f3cffc9d7b25e340257be0cee Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -183,12 +183,15 @@ QIcon Icon::icon() const
|
|||||||
return QIcon(combinedPlainPixmaps(*this));
|
return QIcon(combinedPlainPixmaps(*this));
|
||||||
} else {
|
} else {
|
||||||
QIcon result;
|
QIcon result;
|
||||||
const MasksAndColors masks = masksAndColors(*this, qRound(qApp->devicePixelRatio()));
|
const int maxDpr = qRound(qApp->devicePixelRatio());
|
||||||
const QPixmap combinedMask = Utils::combinedMask(masks, m_style);
|
for (int dpr = 1; dpr <= maxDpr; dpr++) {
|
||||||
result.addPixmap(masksToIcon(masks, combinedMask, m_style));
|
const MasksAndColors masks = masksAndColors(*this, dpr);
|
||||||
|
const QPixmap combinedMask = Utils::combinedMask(masks, m_style);
|
||||||
|
result.addPixmap(masksToIcon(masks, combinedMask, m_style));
|
||||||
|
|
||||||
const QColor disabledColor = creatorTheme()->color(Theme::IconsDisabledColor);
|
const QColor disabledColor = creatorTheme()->color(Theme::IconsDisabledColor);
|
||||||
result.addPixmap(maskToColorAndAlpha(combinedMask, disabledColor), QIcon::Disabled);
|
result.addPixmap(maskToColorAndAlpha(combinedMask, disabledColor), QIcon::Disabled);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user