Theme preview/revert, theme editor enhancements, build and deploy updates

This commit is contained in:
IChooseYou
2026-02-12 12:37:09 -07:00
committed by sysadmin
parent e73b783cda
commit 4b1d3e9d3f
18 changed files with 548 additions and 120 deletions

View File

@@ -3,27 +3,61 @@
#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(const Theme& theme, QWidget* parent = nullptr);
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;
const char* label;
QColor Theme::*field;
QPushButton* button;
QPushButton* swatchBtn = nullptr;
QLabel* hexLabel = nullptr;
};
QVector<SwatchEntry> m_swatches;
void updateSwatch(SwatchEntry& entry);
void pickColor(SwatchEntry& entry);
// ── Contrast pair row ──
struct ContrastEntry {
const char* fgLabel;
const char* bgLabel;
QColor Theme::*fgField;
QColor Theme::*bgField;
QLabel* ratioLabel = nullptr;
QLabel* levelLabel = nullptr;
QPushButton* fixBtn = nullptr;
};
QVector<ContrastEntry> m_contrastPairs;
// ── UI ──
QComboBox* m_themeCombo = nullptr;
QLineEdit* m_nameEdit = nullptr;
QLabel* m_fileInfoLabel = nullptr;
QPushButton* m_previewBtn = nullptr;
bool m_previewing = false;
void loadTheme(int index);
void rebuildSwatches(QVBoxLayout* swatchLayout);
void updateSwatch(int idx);
void updateAllContrast();
void pickColor(int idx);
void autoFixContrast(int idx);
void togglePreview();
};
} // namespace rcx