Correctly load colors from custom themes

PR #19448.
Closes #19447.
This commit is contained in:
Vladimir Golovnev
2023-08-12 18:57:34 +03:00
committed by GitHub
parent 69d60b5f1c
commit 56ba5e5182
2 changed files with 26 additions and 18 deletions

View File

@@ -84,21 +84,24 @@ public:
QByteArray readStyleSheet() override;
protected:
virtual Path themeRootPath() const = 0;
explicit CustomThemeSource(const Path &themeRootPath);
DefaultThemeSource *defaultThemeSource() const;
private:
Path themeRootPath() const;
void loadColors();
const std::unique_ptr<DefaultThemeSource> m_defaultThemeSource = std::make_unique<DefaultThemeSource>();
Path m_themeRootPath;
QHash<QString, QColor> m_colors;
QHash<QString, QColor> m_darkModeColors;
};
class QRCThemeSource final : public CustomThemeSource
{
private:
Path themeRootPath() const override;
public:
QRCThemeSource();
};
class FolderThemeSource : public CustomThemeSource
@@ -109,7 +112,5 @@ public:
QByteArray readStyleSheet() override;
private:
Path themeRootPath() const override;
const Path m_folder;
};