mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
- Replaced hardcoded theme factories with JSON files + CMake build step - Shared ThemeFieldMeta table for DRY serialization and editor UI - Fixed live preview (auto-triggers on color change, no toggle button) - Fixed duplicate theme entries when editing built-in themes - Moved title bar from icon to bold "Reclass" text with View > Show Icon toggle - MDI tabs: 24px height, unicode close button styled like TypeSelectorPopup - Added VS2022 Dark theme with purple accent colors - Status bar padding, removed monospace font overrides on tabs/statusbar - Default startup opens Ball demo + Unnamed hex64 tabs
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#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;
|
|
|
|
QString themeFilePath(int index) const;
|
|
void previewTheme(const Theme& theme);
|
|
void revertPreview();
|
|
|
|
signals:
|
|
void themeChanged(const rcx::Theme& theme);
|
|
|
|
private:
|
|
ThemeManager();
|
|
QVector<Theme> m_builtIn; // built-in themes (possibly overridden)
|
|
QVector<Theme> m_builtInDefaults; // originals loaded from disk
|
|
QVector<Theme> m_user;
|
|
int m_currentIdx = 0;
|
|
|
|
int builtInCount() const { return m_builtIn.size(); }
|
|
void loadBuiltInThemes();
|
|
QString builtInDir() const;
|
|
QString userDir() const;
|
|
bool m_previewing = false;
|
|
Theme m_savedTheme;
|
|
};
|
|
|
|
} // namespace rcx
|