Cockatrice 2026-06-01-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
palette_editor_dialog.h
Go to the documentation of this file.
1#ifndef COCKATRICE_PALETTE_EDITOR_DIALOG_H
2#define COCKATRICE_PALETTE_EDITOR_DIALOG_H
3
4#include "../theme_config.h"
5
6#include <QDialog>
7#include <QFrame>
8#include <QMap>
9
10class QLabel;
11class QComboBox;
12class QDialogButtonBox;
13class QPushButton;
15class QuickSetupPanel;
16
17class PaletteEditorDialog : public QDialog
18{
19 Q_OBJECT
20public:
21 explicit PaletteEditorDialog(const QString &themeDirPath, const QString &themeName, QWidget *parent = nullptr);
22 void loadSchemes();
23
24private slots:
25 void onSave();
26 void onApply();
27 void onReset();
28 void onRevertToDefault();
29 void onSchemeChanged(const QString &scheme);
30 void onGenerateFromAccent(const QColor &accent, int intensity);
31
32private:
33 void setupUi();
34 void retranslateUi();
36 void loadScheme(const QString &scheme); // snapshot current, switch, load
37 void seedAccentFromScheme(const QString &scheme);
38
39 // Sub-widgets
40 QWidget *header;
41 QLabel *titleLabel;
42 QLabel *editingLabel;
45 QPushButton *paletteGridToggleButton = nullptr;
46 QFrame *paletteGridSeparator = nullptr;
47 QWidget *footer;
48 QComboBox *schemeComboBox = nullptr;
49 QDialogButtonBox *buttonBox = nullptr;
50 QPushButton *resetBtn = nullptr;
51 QPushButton *applyBtn = nullptr;
52 QPushButton *saveBtn = nullptr;
53 QPushButton *closeBtn = nullptr;
54 QPushButton *revertButton = nullptr;
55
56 // State
57 QString themeDirPath;
58 QString themeName;
59 QString loadedScheme;
60
61 QMap<QString, PaletteConfig> workingConfig;
62 QMap<QString, PaletteConfig> savedConfig;
63
64protected:
65 void changeEvent(QEvent *e) override;
66};
67
68#endif // COCKATRICE_PALETTE_EDITOR_DIALOG_H
PaletteGridWidget * paletteGrid
Definition palette_editor_dialog.h:44
void onGenerateFromAccent(const QColor &accent, int intensity)
Definition palette_editor_dialog.cpp:241
QuickSetupPanel * quickSetupPanel
Definition palette_editor_dialog.h:43
void changeEvent(QEvent *e) override
Definition palette_editor_dialog.cpp:295
void seedAccentFromScheme(const QString &scheme)
Definition palette_editor_dialog.cpp:220
QWidget * footer
Definition palette_editor_dialog.h:47
void loadSchemes()
Definition palette_editor_dialog.cpp:194
QLabel * editingLabel
Definition palette_editor_dialog.h:42
void retranslateUi()
Definition palette_editor_dialog.cpp:160
QPushButton * saveBtn
Definition palette_editor_dialog.h:52
QLabel * titleLabel
Definition palette_editor_dialog.h:41
QDialogButtonBox * buttonBox
Definition palette_editor_dialog.h:49
QMap< QString, PaletteConfig > workingConfig
Definition palette_editor_dialog.h:61
QString themeName
Definition palette_editor_dialog.h:58
void onReset()
Definition palette_editor_dialog.cpp:277
QMap< QString, PaletteConfig > savedConfig
Definition palette_editor_dialog.h:62
QPushButton * closeBtn
Definition palette_editor_dialog.h:53
void onApply()
Definition palette_editor_dialog.cpp:248
void onSave()
Definition palette_editor_dialog.cpp:253
QPushButton * paletteGridToggleButton
Definition palette_editor_dialog.h:45
void refreshChromePalettes()
Definition palette_editor_dialog.cpp:304
QString themeDirPath
Definition palette_editor_dialog.h:57
void setupUi()
Definition palette_editor_dialog.cpp:40
void onSchemeChanged(const QString &scheme)
Definition palette_editor_dialog.cpp:228
void loadScheme(const QString &scheme)
QFrame * paletteGridSeparator
Definition palette_editor_dialog.h:46
QString loadedScheme
Definition palette_editor_dialog.h:59
QComboBox * schemeComboBox
Definition palette_editor_dialog.h:48
QPushButton * resetBtn
Definition palette_editor_dialog.h:50
PaletteEditorDialog(const QString &themeDirPath, const QString &themeName, QWidget *parent=nullptr)
Definition palette_editor_dialog.cpp:19
QPushButton * revertButton
Definition palette_editor_dialog.h:54
void onRevertToDefault()
Definition palette_editor_dialog.cpp:283
QPushButton * applyBtn
Definition palette_editor_dialog.h:51
QWidget * header
Definition palette_editor_dialog.h:40
Definition palette_grid_widget.h:17
Provides a compact "Quick Setup" interface for generating theme palettes.
Definition quick_setup_panel.h:30