3#include <QtCore/QObject>
6#include <QtQmlIntegration/QtQmlIntegration>
8#define DECLARE_QGC_COLOR(name, lightDisabled, lightEnabled, darkDisabled, darkEnabled) \
10 PaletteColorInfo_t colorInfo = { \
11 { QColor(lightDisabled), QColor(lightEnabled) }, \
12 { QColor(darkDisabled), QColor(darkEnabled) } \
14 QGCCorePlugin::instance()->paletteOverride(#name, colorInfo); \
15 _colorInfoMap[Light][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupEnabled]; \
16 _colorInfoMap[Light][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupDisabled]; \
17 _colorInfoMap[Dark][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupEnabled]; \
18 _colorInfoMap[Dark][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupDisabled]; \
22#define DECLARE_QGC_NONTHEMED_COLOR(name, disabledColor, enabledColor) \
24 PaletteColorInfo_t colorInfo = { \
25 { QColor(disabledColor), QColor(enabledColor) }, \
26 { QColor(disabledColor), QColor(enabledColor) } \
28 QGCCorePlugin::instance()->paletteOverride(#name, colorInfo); \
29 _colorInfoMap[Light][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupEnabled]; \
30 _colorInfoMap[Light][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupDisabled]; \
31 _colorInfoMap[Dark][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupEnabled]; \
32 _colorInfoMap[Dark][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupDisabled]; \
36#define DECLARE_QGC_SINGLE_COLOR(name, color) \
38 PaletteColorInfo_t colorInfo = { \
39 { QColor(color), QColor(color) }, \
40 { QColor(color), QColor(color) } \
42 QGCCorePlugin::instance()->paletteOverride(#name, colorInfo); \
43 _colorInfoMap[Light][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupEnabled]; \
44 _colorInfoMap[Light][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupDisabled]; \
45 _colorInfoMap[Dark][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupEnabled]; \
46 _colorInfoMap[Dark][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupDisabled]; \
50#define DEFINE_QGC_COLOR(NAME, SETNAME) \
51 Q_PROPERTY(QColor NAME READ NAME WRITE SETNAME NOTIFY paletteChanged) \
52 Q_PROPERTY(QStringList NAME ## Colors READ NAME ## Colors NOTIFY paletteChanged) \
53 QColor NAME() const { return _colorInfoMap[_theme][_colorGroupEnabled ? ColorGroupEnabled : ColorGroupDisabled][QStringLiteral(#NAME)]; } \
54 QStringList NAME ## Colors() const { \
56 c << _colorInfoMap[Light][ColorGroupEnabled][QStringLiteral(#NAME)].name(QColor::HexRgb); \
57 c << _colorInfoMap[Light][ColorGroupDisabled][QStringLiteral(#NAME)].name(QColor::HexRgb); \
58 c << _colorInfoMap[Dark][ColorGroupEnabled][QStringLiteral(#NAME)].name(QColor::HexRgb); \
59 c << _colorInfoMap[Dark][ColorGroupDisabled][QStringLiteral(#NAME)].name(QColor::HexRgb); \
62 void SETNAME(const QColor& color) { _colorInfoMap[_theme][_colorGroupEnabled ? ColorGroupEnabled : ColorGroupDisabled][QStringLiteral(#NAME)] = color; _signalPaletteChangeToAll(); }
159 QStringList
colors ()
const {
return _colors; }
170 static void _buildMap ();
171 static void _signalPaletteChangeToAll ();
172 void _signalPaletteChanged ();
173 void _themeChanged ();
176 bool _colorGroupEnabled;
177 static QStringList _colors;
179 static QMap<int, QMap<int, QMap<QString, QColor>>> _colorInfoMap;
180 static QList<QGCPalette*> _paletteObjects;
#define DEFINE_QGC_COLOR(NAME, SETNAME)
void setToolStripHoverColor(const QColor &color)
void setMapButton(const QColor &color)
void setPhotoCaptureButtonColor(const QColor &color)
void setMapIndicator(const QColor &color)
void setAlertText(const QColor &color)
QColor PaletteColorInfo_t[cMaxTheme][cMaxColorGroup]
void setSurveyPolygonInterior(const QColor &color)
void setColorOrange(const QColor &color)
void setButtonBorder(const QColor &color)
void setMapWidgetBorderDark(const QColor &color)
void setPrimaryButtonText(const QColor &color)
void setText(const QColor &color)
void setTextFieldText(const QColor &color)
void setWarningText(const QColor &color)
void setWindowShadeLight(const QColor &color)
void setVideoCaptureButtonColor(const QColor &color)
static void setGlobalTheme(Theme newTheme)
void setWindowShadeDark(const QColor &color)
void setTextField(const QColor &color)
void setWindow(const QColor &color)
void setColorYellow(const QColor &color)
void setWindowTransparentText(const QColor &color)
void setBrandingBlue(const QColor &color)
QStringList colors() const
void setWindowTransparent(const QColor &color)
void setMapButtonHighlight(const QColor &color)
void setButtonHighlight(const QColor &color)
void setToolbarBackground(const QColor &color)
void setPrimaryButton(const QColor &color)
static Theme globalTheme()
void setWindowShade(const QColor &color)
void setAlertBorder(const QColor &color)
void setColorGreen(const QColor &color)
void setColorBlue(const QColor &color)
void setColorRed(const QColor &color)
void setColorGrey(const QColor &color)
void setSurveyPolygonTerrainCollision(const QColor &color)
void setMapWidgetBorderLight(const QColor &color)
void setButtonHighlightText(const QColor &color)
void setstatusFailedText(const QColor &color)
void setMapMissionTrajectory(const QColor &color)
void setButton(const QColor &color)
bool colorGroupEnabled() const
void setToolStripFGColor(const QColor &color)
void setstatusPendingText(const QColor &color)
void setColorGroupEnabled(bool enabled)
void setColorYellowGreen(const QColor &color)
void setstatusPassedText(const QColor &color)
void setGroupBorder(const QColor &color)
void setBrandingPurple(const QColor &color)
void setMapIndicatorChild(const QColor &color)
void setMissionItemEditor(const QColor &color)
void setButtonText(const QColor &color)
void setAlertBackground(const QColor &color)