mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Add theme system with Reclass Dark and Warm built-in themes
Replaces ~40 hardcoded color values with 27 semantic color roles. Adds ThemeManager singleton, theme editor dialog, View > Theme menu, JSON persistence for user themes, and fixes inline edit selection color from blue #264f78 to #2b2b2b.
This commit is contained in:
38
src/themes/thememanager.h
Normal file
38
src/themes/thememanager.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "theme.h"
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
|
||||
namespace rcx {
|
||||
|
||||
class ThemeManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static ThemeManager& instance();
|
||||
|
||||
QVector<Theme> themes() const;
|
||||
int currentIndex() const { return m_currentIdx; }
|
||||
const Theme& current() const;
|
||||
|
||||
void setCurrent(int index);
|
||||
void addTheme(const Theme& theme);
|
||||
void updateTheme(int index, const Theme& theme);
|
||||
void removeTheme(int index);
|
||||
|
||||
void loadUserThemes();
|
||||
void saveUserThemes() const;
|
||||
|
||||
signals:
|
||||
void themeChanged(const rcx::Theme& theme);
|
||||
|
||||
private:
|
||||
ThemeManager();
|
||||
QVector<Theme> m_builtIn;
|
||||
QVector<Theme> m_user;
|
||||
int m_currentIdx = 0;
|
||||
|
||||
int builtInCount() const { return m_builtIn.size(); }
|
||||
QString themesDir() const;
|
||||
};
|
||||
|
||||
} // namespace rcx
|
||||
Reference in New Issue
Block a user