mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Merge branch 'master' of https://github.com/telegramdesktop/tdesktop into dev
This commit is contained in:
@@ -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)));
|
||||
|
Reference in New Issue
Block a user