2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Move all background helper methods to chat_theme module.

This commit is contained in:
John Preston
2021-08-27 14:32:18 +03:00
parent 0a1e84ddb2
commit f5a323e40a
16 changed files with 491 additions and 299 deletions

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "ui/effects/round_checkbox.h"
#include "ui/image/image.h"
#include "ui/chat/chat_theme.h"
#include "ui/ui_utility.h"
#include "main/main_session.h"
#include "apiwrap.h"
@@ -331,7 +332,7 @@ void BackgroundBox::Inner::validatePaperThumbnail(
}
} else if (!paper.data.backgroundColors().empty()) {
paper.thumbnail = Ui::PixmapFromImage(
Data::GenerateWallPaper(
Ui::GenerateBackgroundImage(
st::backgroundSize * cIntRetinaFactor(),
paper.data.backgroundColors(),
paper.data.gradientRotation()));
@@ -346,7 +347,7 @@ void BackgroundBox::Inner::validatePaperThumbnail(
: paper.dataMedia->thumbnail();
auto original = thumbnail->original();
if (paper.data.isPattern()) {
original = Data::PreparePatternImage(
original = Ui::PreparePatternImage(
std::move(original),
paper.data.backgroundColors(),
paper.data.gradientRotation(),