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

Move ChatTheme to td_ui.

This commit is contained in:
John Preston
2021-08-26 18:02:21 +03:00
parent 3cd0f9d189
commit 0a1e84ddb2
37 changed files with 353 additions and 244 deletions

View File

@@ -25,6 +25,7 @@ inline constexpr auto kThemeSchemeSizeLimit = 1024 * 1024;
inline constexpr auto kThemeBackgroundSizeLimit = 4 * 1024 * 1024;
struct ParsedTheme;
struct Colorizer;
[[nodiscard]] bool IsEmbeddedTheme(const QString &path);
@@ -90,11 +91,18 @@ void Revert();
[[nodiscard]] QString EditingPalettePath();
// NB! This method looks to Core::App().settings() to get colorizer by 'file'.
bool LoadFromFile(
const QString &file,
const QString &path,
not_null<Instance*> out,
Cached *outCache,
not_null<QByteArray*> outContent);
QByteArray *outContent);
bool LoadFromFile(
const QString &path,
not_null<Instance*> out,
Cached *outCache,
QByteArray *outContent,
const Colorizer &colorizer);
bool LoadFromContent(
const QByteArray &content,
not_null<Instance*> out,
@@ -272,14 +280,6 @@ private:
[[nodiscard]] ChatBackground *Background();
struct BackgroundRects {
QRect from;
QRect to;
};
[[nodiscard]] BackgroundRects ComputeBackgroundRects(
QSize fillSize,
QSize imageSize);
bool ReadPaletteValues(const QByteArray &content, Fn<bool(QLatin1String name, QLatin1String value)> callback);
} // namespace Theme