mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Pass FileOrigin in all file downloads.
This commit is contained in:
@@ -187,7 +187,7 @@ void PeerData::setUserpicPhoto(const MTPPhoto &data) {
|
||||
|
||||
ImagePtr PeerData::currentUserpic() const {
|
||||
if (_userpic) {
|
||||
_userpic->load();
|
||||
_userpic->load(userpicPhotoOrigin());
|
||||
if (_userpic->loaded()) {
|
||||
if (!useEmptyUserpic()) {
|
||||
_userpicEmpty = nullptr;
|
||||
@@ -200,7 +200,7 @@ ImagePtr PeerData::currentUserpic() const {
|
||||
|
||||
void PeerData::paintUserpic(Painter &p, int x, int y, int size) const {
|
||||
if (auto userpic = currentUserpic()) {
|
||||
p.drawPixmap(x, y, userpic->pixCircled(size, size));
|
||||
p.drawPixmap(x, y, userpic->pixCircled(userpicPhotoOrigin(), size, size));
|
||||
} else {
|
||||
_userpicEmpty->paint(p, x, y, x + size + x, size);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ void PeerData::paintUserpic(Painter &p, int x, int y, int size) const {
|
||||
|
||||
void PeerData::paintUserpicRounded(Painter &p, int x, int y, int size) const {
|
||||
if (auto userpic = currentUserpic()) {
|
||||
p.drawPixmap(x, y, userpic->pixRounded(size, size, ImageRoundRadius::Small));
|
||||
p.drawPixmap(x, y, userpic->pixRounded(userpicPhotoOrigin(), size, size, ImageRoundRadius::Small));
|
||||
} else {
|
||||
_userpicEmpty->paintRounded(p, x, y, x + size + x, size);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void PeerData::paintUserpicRounded(Painter &p, int x, int y, int size) const {
|
||||
|
||||
void PeerData::paintUserpicSquare(Painter &p, int x, int y, int size) const {
|
||||
if (auto userpic = currentUserpic()) {
|
||||
p.drawPixmap(x, y, userpic->pix(size, size));
|
||||
p.drawPixmap(x, y, userpic->pix(userpicPhotoOrigin(), size, size));
|
||||
} else {
|
||||
_userpicEmpty->paintSquare(p, x, y, x + size + x, size);
|
||||
}
|
||||
@@ -239,7 +239,7 @@ void PeerData::saveUserpicRounded(const QString &path, int size) const {
|
||||
|
||||
QPixmap PeerData::genUserpic(int size) const {
|
||||
if (auto userpic = currentUserpic()) {
|
||||
return userpic->pixCircled(size, size);
|
||||
return userpic->pixCircled(userpicPhotoOrigin(), size, size);
|
||||
}
|
||||
auto result = QImage(QSize(size, size) * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied);
|
||||
result.setDevicePixelRatio(cRetinaFactor());
|
||||
@@ -253,7 +253,7 @@ QPixmap PeerData::genUserpic(int size) const {
|
||||
|
||||
QPixmap PeerData::genUserpicRounded(int size) const {
|
||||
if (auto userpic = currentUserpic()) {
|
||||
return userpic->pixRounded(size, size, ImageRoundRadius::Small);
|
||||
return userpic->pixRounded(userpicPhotoOrigin(), size, size, ImageRoundRadius::Small);
|
||||
}
|
||||
auto result = QImage(QSize(size, size) * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied);
|
||||
result.setDevicePixelRatio(cRetinaFactor());
|
||||
|
Reference in New Issue
Block a user