2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Don't use MTP* for WallPaper flags.

This commit is contained in:
John Preston
2021-08-12 12:32:30 +03:00
parent 474a6a71d9
commit 85cc3b30a0
8 changed files with 321 additions and 136 deletions

View File

@@ -255,7 +255,7 @@ void BackgroundBox::Inner::updatePapers() {
_papers = _session->data().wallpapers(
) | ranges::views::filter([](const Data::WallPaper &paper) {
return !paper.isPattern() || paper.backgroundColor().has_value();
return !paper.isPattern() || !paper.backgroundColors().empty();
}) | ranges::views::transform([](const Data::WallPaper &paper) {
return Paper{ paper };
}) | ranges::to_vector;
@@ -336,6 +336,7 @@ void BackgroundBox::Inner::validatePaperThumbnail(
: paper.dataMedia->thumbnail();
auto original = thumbnail->original();
if (paper.data.isPattern()) {
// #TODO themes gradients
const auto color = *paper.data.backgroundColor();
original = Data::PreparePatternImage(
std::move(original),