mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Theme preview/revert, theme editor enhancements, build and deploy updates
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user