2019-08-23 13:52:59 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "lang/lang_keys.h"
|
|
|
|
|
|
|
|
class QImage;
|
|
|
|
|
2021-09-02 16:58:04 +00:00
|
|
|
namespace style {
|
|
|
|
struct colorizer;
|
|
|
|
} // namespace style
|
|
|
|
|
2019-08-23 13:52:59 +00:00
|
|
|
namespace Window {
|
|
|
|
namespace Theme {
|
|
|
|
|
|
|
|
enum class EmbeddedType {
|
|
|
|
DayBlue,
|
|
|
|
Default,
|
|
|
|
Night,
|
|
|
|
NightGreen,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct EmbeddedScheme {
|
|
|
|
EmbeddedType type = EmbeddedType();
|
|
|
|
QColor background;
|
|
|
|
QColor sent;
|
|
|
|
QColor received;
|
|
|
|
QColor radiobuttonInactive;
|
|
|
|
QColor radiobuttonActive;
|
|
|
|
tr::phrase<> name;
|
|
|
|
QString path;
|
|
|
|
QColor accentColor;
|
|
|
|
};
|
|
|
|
|
|
|
|
class AccentColors final {
|
|
|
|
public:
|
|
|
|
[[nodiscard]] QByteArray serialize() const;
|
|
|
|
bool setFromSerialized(const QByteArray &serialized);
|
|
|
|
|
|
|
|
void set(EmbeddedType type, const QColor &value);
|
|
|
|
void clear(EmbeddedType type);
|
|
|
|
[[nodiscard]] std::optional<QColor> get(EmbeddedType type) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
base::flat_map<EmbeddedType, QColor> _data;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-09-02 16:58:04 +00:00
|
|
|
[[nodiscard]] style::colorizer ColorizerFrom(
|
2019-08-23 13:52:59 +00:00
|
|
|
const EmbeddedScheme &scheme,
|
|
|
|
const QColor &color);
|
2021-09-02 16:58:04 +00:00
|
|
|
[[nodiscard]] style::colorizer ColorizerForTheme(const QString &absolutePath);
|
2019-08-23 13:52:59 +00:00
|
|
|
|
|
|
|
void Colorize(
|
2021-09-02 16:58:04 +00:00
|
|
|
EmbeddedScheme &scheme,
|
|
|
|
const style::colorizer &colorizer);
|
2019-08-23 13:52:59 +00:00
|
|
|
|
|
|
|
[[nodiscard]] std::vector<EmbeddedScheme> EmbeddedThemes();
|
|
|
|
[[nodiscard]] std::vector<QColor> DefaultAccentColors(EmbeddedType type);
|
|
|
|
|
|
|
|
} // namespace Theme
|
|
|
|
} // namespace Window
|