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:
IChooseYou
2026-02-10 07:46:18 -07:00
parent 8eab304538
commit 24a7e68136
12 changed files with 885 additions and 208 deletions

38
src/themes/thememanager.h Normal file
View 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