Use json file based themes instead of code to create them (theme editor + theme mode settings)

This commit is contained in:
luisangelsm
2026-03-02 21:23:39 +01:00
parent 87fada611d
commit 547e48cc04
42 changed files with 2776 additions and 1145 deletions

View File

@ -1,11 +1,13 @@
#ifndef THEME_MANAGER_H
#define THEME_MANAGER_H
#include "appearance_configuration.h"
#include "theme.h"
#include "theme_id.h"
#include <QtCore>
class ThemeRepository;
class ThemeManager : public QObject
{
Q_OBJECT
@ -17,21 +19,27 @@ public:
ThemeManager(ThemeManager &&) = delete;
ThemeManager &operator=(ThemeManager &&) = delete;
void initialize();
void setTheme(ThemeId themeId);
void initialize(AppearanceConfiguration *config, ThemeRepository *repository);
void setTheme(const Theme &theme);
const Theme &getCurrentTheme() const { return currentTheme; }
AppearanceConfiguration *getAppearanceConfiguration() const { return config; }
signals:
void themeChanged();
private:
explicit ThemeManager();
ThemeId themeId = ThemeId::Classic;
AppearanceConfiguration *config = nullptr;
ThemeRepository *repository = nullptr;
Theme currentTheme;
void updateCurrentTheme();
Theme themeFromId(const QString &id, ThemeVariant fallbackVariant);
private slots:
void resolveTheme();
};
#endif // THEME_MANAGER_H