mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 03:28:49 -07:00
[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:
parent
989a5be23b
commit
117ea543c5
23 changed files with 1874 additions and 232 deletions
37
cockatrice/src/interface/theme_config.h
Normal file
37
cockatrice/src/interface/theme_config.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef COCKATRICE_THEME_CONFIG_H
|
||||
#define COCKATRICE_THEME_CONFIG_H
|
||||
|
||||
#include <QColor>
|
||||
#include <QMap>
|
||||
#include <QPalette>
|
||||
#include <QString>
|
||||
|
||||
struct ThemeConfig
|
||||
{
|
||||
QString colorScheme;
|
||||
QString styleName;
|
||||
|
||||
bool isEmpty() const;
|
||||
QString toIni() const;
|
||||
|
||||
static ThemeConfig fromThemeDir(const QString &themeDirPath);
|
||||
bool save(const QString &themeDirPath) const;
|
||||
};
|
||||
|
||||
struct PaletteConfig
|
||||
{
|
||||
QMap<QPalette::ColorGroup, QMap<QPalette::ColorRole, QColor>> colors;
|
||||
|
||||
bool hasPalette() const;
|
||||
QString toToml() const;
|
||||
|
||||
static QString fileName(const QString &colorScheme);
|
||||
|
||||
static PaletteConfig fromFile(const QString &filePath);
|
||||
static PaletteConfig fromScheme(const QString &themeDirPath, const QString &colorScheme);
|
||||
static PaletteConfig fromDefault(const QString &themeDirPath, const QString &colorScheme);
|
||||
|
||||
QPalette apply(QPalette base) const;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_THEME_CONFIG_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue