mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Ensure contrast in colorized themes.
This commit is contained in:
@@ -18,8 +18,6 @@ namespace Theme {
|
||||
|
||||
constexpr auto kThemeSchemeSizeLimit = 1024 * 1024;
|
||||
|
||||
struct Colorizer;
|
||||
|
||||
struct Cached {
|
||||
QByteArray colors;
|
||||
QByteArray background;
|
||||
@@ -53,26 +51,21 @@ struct Preview {
|
||||
|
||||
bool Apply(const QString &filepath);
|
||||
bool Apply(std::unique_ptr<Preview> preview);
|
||||
void ApplyDefaultWithPath(
|
||||
const QString &themePath,
|
||||
const Colorizer *colorizer = nullptr);
|
||||
void ApplyDefaultWithPath(const QString &themePath);
|
||||
bool ApplyEditedPalette(const QString &path, const QByteArray &content);
|
||||
void KeepApplied();
|
||||
QString NightThemePath();
|
||||
[[nodiscard]] bool IsNightMode();
|
||||
void SetNightModeValue(bool nightMode);
|
||||
void ToggleNightMode();
|
||||
void ToggleNightMode(
|
||||
const QString &themePath,
|
||||
const Colorizer *colorizer = nullptr);
|
||||
void ToggleNightMode(const QString &themePath);
|
||||
[[nodiscard]] bool IsNonDefaultBackground();
|
||||
void Revert();
|
||||
|
||||
bool LoadFromFile(
|
||||
const QString &file,
|
||||
Instance *out,
|
||||
QByteArray *outContent,
|
||||
const Colorizer *colorizer = nullptr);
|
||||
QByteArray *outContent);
|
||||
bool IsPaletteTestingPath(const QString &path);
|
||||
QColor CountAverageColor(const QImage &image);
|
||||
QColor AdjustedColor(QColor original, QColor background);
|
||||
@@ -162,9 +155,7 @@ private:
|
||||
|
||||
void setNightModeValue(bool nightMode);
|
||||
[[nodiscard]] bool nightMode() const;
|
||||
void toggleNightMode(
|
||||
std::optional<QString> themePath,
|
||||
const Colorizer *colorizer);
|
||||
void toggleNightMode(std::optional<QString> themePath);
|
||||
void keepApplied(const QString &path, bool write);
|
||||
[[nodiscard]] bool isNonDefaultThemeOrBackground();
|
||||
[[nodiscard]] bool isNonDefaultBackground();
|
||||
@@ -174,9 +165,7 @@ private:
|
||||
friend bool IsNightMode();
|
||||
friend void SetNightModeValue(bool nightMode);
|
||||
friend void ToggleNightMode();
|
||||
friend void ToggleNightMode(
|
||||
const QString &themePath,
|
||||
const Colorizer *colorizer);
|
||||
friend void ToggleNightMode(const QString &themePath);
|
||||
friend void KeepApplied();
|
||||
friend bool IsNonDefaultBackground();
|
||||
|
||||
|
Reference in New Issue
Block a user