2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00
This commit is contained in:
John Preston
2015-04-16 18:00:43 +03:00
15 changed files with 79 additions and 18 deletions

View File

@@ -1812,16 +1812,22 @@ namespace App {
if (Local::readBackground()) return;
QImage img(p);
bool remove = false;
if (p.isNull()) {
img.load(st::msgBG);
id = 0;
remove = true;
}
if (img.format() != QImage::Format_ARGB32 && img.format() != QImage::Format_ARGB32_Premultiplied && img.format() != QImage::Format_RGB32) {
img = img.convertToFormat(QImage::Format_RGB32);
}
img.setDevicePixelRatio(cRetinaFactor());
if (!nowrite) Local::writeBackground(id, img);
if (remove) {
Local::writeBackground(0, QImage());
} else if (!nowrite) {
Local::writeBackground(id, img);
}
delete cChatBackground();
cSetChatBackground(new QPixmap(QPixmap::fromImage(img, Qt::ColorOnly)));