2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Retina handling fixed in the new notifications.

This commit is contained in:
John Preston
2016-10-07 16:14:02 +03:00
parent eb47b9468c
commit 15ee4b40dc
5 changed files with 23 additions and 9 deletions

View File

@@ -515,6 +515,7 @@ void Notification::prepareActionsCache() {
auto actionsCacheWidth = _reply->width() + _replyPadding + fadeWidth;
auto actionsCacheHeight = height() - actionsTop;
auto actionsCacheImg = QImage(actionsCacheWidth * cIntRetinaFactor(), actionsCacheHeight * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied);
actionsCacheImg.setDevicePixelRatio(cRetinaFactor());
actionsCacheImg.fill(st::transparent->c);
{
Painter p(&actionsCacheImg);
@@ -611,6 +612,7 @@ void Notification::updateNotifyDisplay() {
_history->peer->paintUserpicLeft(p, st::notifyPhotoSize, st::notifyPhotoPos.x(), st::notifyPhotoPos.y(), width());
} else {
static QPixmap icon = App::pixmapFromImageInPlace(App::wnd()->iconLarge().scaled(st::notifyPhotoSize, st::notifyPhotoSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
icon.setDevicePixelRatio(cRetinaFactor());
p.drawPixmap(st::notifyPhotoPos.x(), st::notifyPhotoPos.y(), icon);
}