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

Allow changing accent color in default themes.

This commit is contained in:
John Preston
2019-08-20 19:03:14 +03:00
parent dd136350fb
commit 9cb5423d40
5 changed files with 155 additions and 50 deletions

View File

@@ -908,7 +908,9 @@ void Generator::restoreTextPalette() {
} // namespace
std::unique_ptr<Preview> PreviewFromFile(const QString &filepath) {
std::unique_ptr<Preview> PreviewFromFile(
const QString &filepath,
const Colorizer *colorizer) {
auto result = std::make_unique<Preview>();
result->pathRelative = filepath.isEmpty()
? QString()
@@ -916,7 +918,11 @@ std::unique_ptr<Preview> PreviewFromFile(const QString &filepath) {
result->pathAbsolute = filepath.isEmpty()
? QString()
: QFileInfo(filepath).absoluteFilePath();
if (!LoadFromFile(filepath, &result->instance, &result->content)) {
if (!LoadFromFile(
filepath,
&result->instance,
&result->content,
colorizer)) {
return nullptr;
}
return result;