init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
68
Telegram/SourceFiles/window/themes/window_themes_embedded.h
Normal file
68
Telegram/SourceFiles/window/themes/window_themes_embedded.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
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
|
||||
|
||||
namespace style {
|
||||
struct colorizer;
|
||||
} // namespace style
|
||||
|
||||
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;
|
||||
rpl::producer<QString> 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;
|
||||
|
||||
};
|
||||
|
||||
[[nodiscard]] style::colorizer ColorizerFrom(
|
||||
const EmbeddedScheme &scheme,
|
||||
const QColor &color);
|
||||
[[nodiscard]] style::colorizer ColorizerForTheme(const QString &absolutePath);
|
||||
|
||||
void Colorize(
|
||||
EmbeddedScheme &scheme,
|
||||
const style::colorizer &colorizer);
|
||||
|
||||
[[nodiscard]] std::vector<EmbeddedScheme> EmbeddedThemes();
|
||||
[[nodiscard]] std::vector<QColor> DefaultAccentColors(EmbeddedType type);
|
||||
|
||||
[[nodiscard]] Fn<void(style::palette&)> PreparePaletteCallback(
|
||||
bool dark,
|
||||
std::optional<QColor> accent);
|
||||
[[nodiscard]] Fn<void(style::palette&)> PrepareCurrentPaletteCallback();
|
||||
|
||||
} // namespace Theme
|
||||
} // namespace Window
|
||||
Reference in New Issue
Block a user