Files
archived-Reclass/src/themes/themeeditor.h
IChooseYou a86912add1 Theme system overhaul, UI polish, and VS2022 Dark theme
- 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
2026-02-13 16:23:12 -07:00

46 lines
1.0 KiB
C++

#pragma once
#include "theme.h"
#include <QDialog>
#include <QVector>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
class QScrollArea;
class QVBoxLayout;
class QComboBox;
namespace rcx {
class ThemeEditor : public QDialog {
Q_OBJECT
public:
explicit ThemeEditor(int themeIndex, QWidget* parent = nullptr);
Theme result() const { return m_theme; }
int selectedIndex() const { return m_themeIndex; }
private:
Theme m_theme;
int m_themeIndex;
// ── Swatch row (compact: label + swatch + hex) ──
struct SwatchEntry {
const char* label;
QColor Theme::*field;
QPushButton* swatchBtn = nullptr;
QLabel* hexLabel = nullptr;
};
QVector<SwatchEntry> m_swatches;
// ── UI ──
QComboBox* m_themeCombo = nullptr;
QLineEdit* m_nameEdit = nullptr;
QLabel* m_fileInfoLabel = nullptr;
void loadTheme(int index);
void updateSwatch(int idx);
void pickColor(int idx);
};
} // namespace rcx