2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Pass correct FileOrigin for userpics.

This commit is contained in:
John Preston
2018-10-31 13:55:22 +04:00
parent e6c4c48261
commit 8850d974a2
4 changed files with 16 additions and 13 deletions

View File

@@ -523,13 +523,13 @@ void Panel::refreshUserPhoto() {
if (isGoodUserPhoto(photo) && isNewPhoto(photo)) {
_userPhotoId = photo->id;
_userPhotoFull = true;
createUserpicCache(photo->full);
createUserpicCache(photo->full, _user->userpicPhotoOrigin());
} else if (_userPhoto.isNull()) {
createUserpicCache(_user->currentUserpic());
createUserpicCache(_user->currentUserpic(), _user->userpicOrigin());
}
}
void Panel::createUserpicCache(ImagePtr image) {
void Panel::createUserpicCache(ImagePtr image, Data::FileOrigin origin) {
auto size = st::callWidth * cIntRetinaFactor();
auto options = _useTransparency ? (Images::Option::RoundedLarge | Images::Option::RoundedTopLeft | Images::Option::RoundedTopRight | Images::Option::Smooth) : Images::Option::None;
if (image) {
@@ -543,7 +543,7 @@ void Panel::createUserpicCache(ImagePtr image) {
width = size;
}
_userPhoto = image->pixNoCache(
_user->userpicPhotoOrigin(),
origin,
width,
height,
options,

View File

@@ -92,7 +92,7 @@ private:
void processUserPhoto();
void refreshUserPhoto();
bool isGoodUserPhoto(PhotoData *photo);
void createUserpicCache(ImagePtr image);
void createUserpicCache(ImagePtr image, Data::FileOrigin origin);
QRect signalBarsRect() const;
void paintSignalBarsBg(Painter &p);