[App/Theme] Palette Editor (#6877)

* [App/Theme] Palette Editor

Took 1 minute

Took 1 hour 47 minutes

Took 6 seconds

Took 3 minutes

Took 5 minutes


Took 3 minutes

* Add oracle, add palette files and configs.

Took 10 minutes

* Fix a stupid include mistake, thanks IDE

Took 3 minutes

Took 20 seconds

* Includes.

Took 4 minutes

* Fix ampersand not displaying correctly.

Took 14 minutes

* Longer variable names.

Took 10 minutes

Took 5 seconds

* Change ampersand everywhere

Took 23 seconds

* Doxygen properly.

Took 1 minute

* Remove namespace, fold I/O into structs.

Took 12 minutes

* Remove namespace, fold I/O into structs.

Took 33 seconds

* Alphabetize.

Took 35 seconds

* Lint.

Took 49 seconds

* Add a combo box to quick switch settings.

Took 19 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-05-17 10:08:00 +02:00 committed by GitHub
parent 989a5be23b
commit 117ea543c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1874 additions and 232 deletions

View file

@ -0,0 +1,38 @@
#ifndef COCKATRICE_PALETTE_GRID_WIDGET_H
#define COCKATRICE_PALETTE_GRID_WIDGET_H
#include "../theme_config.h"
#include "color_button.h"
#include <QMap>
#include <QPalette>
#include <QVBoxLayout>
#include <QWidget>
class QLabel;
class QScrollArea;
// Scrollable grid of ColorButtons — one per (ColorGroup × ColorRole) cell.
// Owns the load/read round-trip for PaletteConfig but has no file I/O itself.
class PaletteGridWidget : public QWidget
{
Q_OBJECT
public:
explicit PaletteGridWidget(QWidget *parent = nullptr);
void loadPalette(const PaletteConfig &cfg);
PaletteConfig currentPaletteConfig() const;
private:
void buildGrid(QWidget *host);
void changeEvent(QEvent *e);
void refreshChromePalettes();
QMap<QPalette::ColorGroup, QMap<QPalette::ColorRole, ColorButton *>> colorButtons;
QScrollArea *scroll;
QWidget *gridHost;
QVBoxLayout *layout;
QVector<QLabel *> headerLabels;
QVector<QWidget *> rowShadeWidgets;
};
#endif // COCKATRICE_PALETTE_GRID_WIDGET_H