mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Use json file based themes instead of code to create them (theme editor + theme mode settings)
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user