2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Move Image and derived to ui/image.

This commit is contained in:
John Preston
2018-10-11 18:54:57 +03:00
parent d56a3d015b
commit 113f665295
48 changed files with 1917 additions and 1776 deletions

View File

@@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/localstorage.h"
#include "ui/empty_userpic.h"
#include "ui/text_options.h"
#include "ui/image.h"
namespace {
@@ -221,6 +222,20 @@ void PeerData::paintUserpicSquare(Painter &p, int x, int y, int size) const {
}
}
void PeerData::loadUserpic(bool loadFirst, bool prior) {
_userpic->load(userpicPhotoOrigin(), loadFirst, prior);
}
bool PeerData::userpicLoaded() const {
return _userpic->loaded();
}
bool PeerData::useEmptyUserpic() const {
return _userpicLocation.isNull()
|| !_userpic
|| !_userpic->loaded();
}
StorageKey PeerData::userpicUniqueKey() const {
if (useEmptyUserpic()) {
return _userpicEmpty->uniqueKey();
@@ -296,7 +311,7 @@ void PeerData::setUserpicChecked(
const StorageImageLocation &location,
ImagePtr userpic) {
if (_userpicPhotoId != photoId
|| _userpic.v() != userpic.v()
|| _userpic.get() != userpic.get()
|| _userpicLocation != location) {
setUserpic(photoId, location, userpic);
Notify::peerUpdatedDelayed(this, UpdateFlag::PhotoChanged);