Commit 578d2548 authored by DoinLakeFlyer's avatar DoinLakeFlyer

parent 18409818
...@@ -81,11 +81,15 @@ void QGCPalette::_buildMap() ...@@ -81,11 +81,15 @@ void QGCPalette::_buildMap()
DECLARE_QGC_COLOR(statusPassedText, "#9d9d9d", "#000000", "#707070", "#ffffff") DECLARE_QGC_COLOR(statusPassedText, "#9d9d9d", "#000000", "#707070", "#ffffff")
DECLARE_QGC_COLOR(statusPendingText, "#9d9d9d", "#000000", "#707070", "#ffffff") DECLARE_QGC_COLOR(statusPendingText, "#9d9d9d", "#000000", "#707070", "#ffffff")
// Colors are not affecting by theming // Colors not affecting by theming
DECLARE_QGC_COLOR(mapWidgetBorderLight, "#ffffff", "#ffffff", "#ffffff", "#ffffff") // Disabled Enabled
DECLARE_QGC_COLOR(mapWidgetBorderDark, "#000000", "#000000", "#000000", "#000000") DECLARE_QGC_NONTHEMED_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D")
DECLARE_QGC_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D", "#4A2C6D", "#4A2C6D") DECLARE_QGC_NONTHEMED_COLOR(brandingBlue, "#48D6FF", "#6045c5")
DECLARE_QGC_COLOR(brandingBlue, "#48D6FF", "#6045c5", "#48D6FF", "#6045c5")
// Colors not affecting by theming or enable/disable
DECLARE_QGC_SINGLE_COLOR(mapWidgetBorderLight, "#ffffff")
DECLARE_QGC_SINGLE_COLOR(mapWidgetBorderDark, "#000000")
DECLARE_QGC_SINGLE_COLOR(mapMissionTrajectory, "#be781c")
} }
void QGCPalette::setColorGroupEnabled(bool enabled) void QGCPalette::setColorGroupEnabled(bool enabled)
......
...@@ -28,6 +28,34 @@ ...@@ -28,6 +28,34 @@
_colors << #name; \ _colors << #name; \
} }
#define DECLARE_QGC_NONTHEMED_COLOR(name, disabledColor, enabledColor) \
{ \
PaletteColorInfo_t colorInfo = { \
{ QColor(disabledColor), QColor(enabledColor) }, \
{ QColor(disabledColor), QColor(enabledColor) } \
}; \
qgcApp()->toolbox()->corePlugin()->paletteOverride(#name, colorInfo); \
_colorInfoMap[Light][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupEnabled]; \
_colorInfoMap[Light][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupDisabled]; \
_colorInfoMap[Dark][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupEnabled]; \
_colorInfoMap[Dark][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupDisabled]; \
_colors << #name; \
}
#define DECLARE_QGC_SINGLE_COLOR(name, color) \
{ \
PaletteColorInfo_t colorInfo = { \
{ QColor(color), QColor(color) }, \
{ QColor(color), QColor(color) } \
}; \
qgcApp()->toolbox()->corePlugin()->paletteOverride(#name, colorInfo); \
_colorInfoMap[Light][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupEnabled]; \
_colorInfoMap[Light][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Light][ColorGroupDisabled]; \
_colorInfoMap[Dark][ColorGroupEnabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupEnabled]; \
_colorInfoMap[Dark][ColorGroupDisabled][QStringLiteral(#name)] = colorInfo[Dark][ColorGroupDisabled]; \
_colors << #name; \
}
#define DEFINE_QGC_COLOR(NAME, SETNAME) \ #define DEFINE_QGC_COLOR(NAME, SETNAME) \
Q_PROPERTY(QColor NAME READ NAME WRITE SETNAME NOTIFY paletteChanged) \ Q_PROPERTY(QColor NAME READ NAME WRITE SETNAME NOTIFY paletteChanged) \
Q_PROPERTY(QStringList NAME ## Colors READ NAME ## Colors NOTIFY paletteChanged) \ Q_PROPERTY(QStringList NAME ## Colors READ NAME ## Colors NOTIFY paletteChanged) \
...@@ -103,6 +131,7 @@ public: ...@@ -103,6 +131,7 @@ public:
DEFINE_QGC_COLOR(mapIndicatorChild, setMapIndicatorChild) DEFINE_QGC_COLOR(mapIndicatorChild, setMapIndicatorChild)
DEFINE_QGC_COLOR(mapWidgetBorderLight, setMapWidgetBorderLight) DEFINE_QGC_COLOR(mapWidgetBorderLight, setMapWidgetBorderLight)
DEFINE_QGC_COLOR(mapWidgetBorderDark, setMapWidgetBorderDark) DEFINE_QGC_COLOR(mapWidgetBorderDark, setMapWidgetBorderDark)
DEFINE_QGC_COLOR(mapMissionTrajectory, setMapMissionTrajectory)
DEFINE_QGC_COLOR(brandingPurple, setBrandingPurple) DEFINE_QGC_COLOR(brandingPurple, setBrandingPurple)
DEFINE_QGC_COLOR(brandingBlue, setBrandingBlue) DEFINE_QGC_COLOR(brandingBlue, setBrandingBlue)
DEFINE_QGC_COLOR(colorGreen, setColorGreen) DEFINE_QGC_COLOR(colorGreen, setColorGreen)
......
...@@ -67,6 +67,7 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox) ...@@ -67,6 +67,7 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
_gpsRtkFactGroup = qgcApp()->gpsRtkFactGroup(); _gpsRtkFactGroup = qgcApp()->gpsRtkFactGroup();
_airspaceManager = toolbox->airspaceManager(); _airspaceManager = toolbox->airspaceManager();
_adsbVehicleManager = toolbox->adsbVehicleManager(); _adsbVehicleManager = toolbox->adsbVehicleManager();
_globalPalette = new QGCPalette(this);
#if defined(QGC_ENABLE_PAIRING) #if defined(QGC_ENABLE_PAIRING)
_pairingManager = toolbox->pairingManager(); _pairingManager = toolbox->pairingManager();
#endif #endif
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "AppSettings.h" #include "AppSettings.h"
#include "AirspaceManager.h" #include "AirspaceManager.h"
#include "ADSBVehicleManager.h" #include "ADSBVehicleManager.h"
#include "QGCPalette.h"
#if defined(QGC_ENABLE_PAIRING) #if defined(QGC_ENABLE_PAIRING)
#include "PairingManager.h" #include "PairingManager.h"
#endif #endif
...@@ -81,6 +82,7 @@ public: ...@@ -81,6 +82,7 @@ public:
Q_PROPERTY(MicrohardManager* microhardManager READ microhardManager CONSTANT) Q_PROPERTY(MicrohardManager* microhardManager READ microhardManager CONSTANT)
Q_PROPERTY(bool microhardSupported READ microhardSupported CONSTANT) Q_PROPERTY(bool microhardSupported READ microhardSupported CONSTANT)
Q_PROPERTY(bool supportsPairing READ supportsPairing CONSTANT) Q_PROPERTY(bool supportsPairing READ supportsPairing CONSTANT)
Q_PROPERTY(QGCPalette* globalPalette MEMBER _globalPalette CONSTANT) // This palette will always return enabled colors
#if defined(QGC_ENABLE_PAIRING) #if defined(QGC_ENABLE_PAIRING)
Q_PROPERTY(PairingManager* pairingManager READ pairingManager CONSTANT) Q_PROPERTY(PairingManager* pairingManager READ pairingManager CONSTANT)
#endif #endif
...@@ -280,6 +282,7 @@ private: ...@@ -280,6 +282,7 @@ private:
TaisyncManager* _taisyncManager = nullptr; TaisyncManager* _taisyncManager = nullptr;
MicrohardManager* _microhardManager = nullptr; MicrohardManager* _microhardManager = nullptr;
ADSBVehicleManager* _adsbVehicleManager = nullptr; ADSBVehicleManager* _adsbVehicleManager = nullptr;
QGCPalette* _globalPalette = nullptr;
#if defined(QGC_ENABLE_PAIRING) #if defined(QGC_ENABLE_PAIRING)
PairingManager* _pairingManager = nullptr; PairingManager* _pairingManager = nullptr;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment