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

Use new HistoryWallPaper media type for wallpaper.

This commit is contained in:
John Preston
2019-01-29 19:26:19 +03:00
parent fd8e9dad92
commit 5ca12a73c3
24 changed files with 683 additions and 192 deletions

View File

@@ -593,6 +593,7 @@ bool DocumentData::checkWallPaperProperties() {
return false;
}
type = WallPaperDocument;
validateGoodThumbnail();
return true;
}
@@ -615,6 +616,10 @@ bool DocumentData::isWallPaper() const {
return (type == WallPaperDocument);
}
bool DocumentData::isPatternWallPaper() const {
return isWallPaper() && hasMimeType(qstr("image/png"));
}
bool DocumentData::hasThumbnail() const {
return !_thumbnail->isNull();
}
@@ -642,7 +647,7 @@ Image *DocumentData::goodThumbnail() const {
}
void DocumentData::validateGoodThumbnail() {
if (!isVideoFile() && !isAnimation()) {
if (!isVideoFile() && !isAnimation() && !isWallPaper()) {
_goodThumbnail = nullptr;
} else if (!_goodThumbnail && hasRemoteLocation()) {
_goodThumbnail = std::make_unique<Image>(