Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
578d2548
Commit
578d2548
authored
Mar 26, 2020
by
DoinLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
18409818
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
5 deletions
+42
-5
QGCPalette.cc
src/QGCPalette.cc
+9
-5
QGCPalette.h
src/QGCPalette.h
+29
-0
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+1
-0
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+3
-0
No files found.
src/QGCPalette.cc
View file @
578d2548
...
...
@@ -81,11 +81,15 @@ void QGCPalette::_buildMap()
DECLARE_QGC_COLOR
(
statusPassedText
,
"#9d9d9d"
,
"#000000"
,
"#707070"
,
"#ffffff"
)
DECLARE_QGC_COLOR
(
statusPendingText
,
"#9d9d9d"
,
"#000000"
,
"#707070"
,
"#ffffff"
)
// Colors are not affecting by theming
DECLARE_QGC_COLOR
(
mapWidgetBorderLight
,
"#ffffff"
,
"#ffffff"
,
"#ffffff"
,
"#ffffff"
)
DECLARE_QGC_COLOR
(
mapWidgetBorderDark
,
"#000000"
,
"#000000"
,
"#000000"
,
"#000000"
)
DECLARE_QGC_COLOR
(
brandingPurple
,
"#4A2C6D"
,
"#4A2C6D"
,
"#4A2C6D"
,
"#4A2C6D"
)
DECLARE_QGC_COLOR
(
brandingBlue
,
"#48D6FF"
,
"#6045c5"
,
"#48D6FF"
,
"#6045c5"
)
// Colors not affecting by theming
// Disabled Enabled
DECLARE_QGC_NONTHEMED_COLOR
(
brandingPurple
,
"#4A2C6D"
,
"#4A2C6D"
)
DECLARE_QGC_NONTHEMED_COLOR
(
brandingBlue
,
"#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
)
...
...
src/QGCPalette.h
View file @
578d2548
...
...
@@ -28,6 +28,34 @@
_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) \
Q_PROPERTY(QColor NAME READ NAME WRITE SETNAME NOTIFY paletteChanged) \
Q_PROPERTY(QStringList NAME ## Colors READ NAME ## Colors NOTIFY paletteChanged) \
...
...
@@ -103,6 +131,7 @@ public:
DEFINE_QGC_COLOR
(
mapIndicatorChild
,
setMapIndicatorChild
)
DEFINE_QGC_COLOR
(
mapWidgetBorderLight
,
setMapWidgetBorderLight
)
DEFINE_QGC_COLOR
(
mapWidgetBorderDark
,
setMapWidgetBorderDark
)
DEFINE_QGC_COLOR
(
mapMissionTrajectory
,
setMapMissionTrajectory
)
DEFINE_QGC_COLOR
(
brandingPurple
,
setBrandingPurple
)
DEFINE_QGC_COLOR
(
brandingBlue
,
setBrandingBlue
)
DEFINE_QGC_COLOR
(
colorGreen
,
setColorGreen
)
...
...
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
578d2548
...
...
@@ -67,6 +67,7 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
_gpsRtkFactGroup
=
qgcApp
()
->
gpsRtkFactGroup
();
_airspaceManager
=
toolbox
->
airspaceManager
();
_adsbVehicleManager
=
toolbox
->
adsbVehicleManager
();
_globalPalette
=
new
QGCPalette
(
this
);
#if defined(QGC_ENABLE_PAIRING)
_pairingManager
=
toolbox
->
pairingManager
();
#endif
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
578d2548
...
...
@@ -24,6 +24,7 @@
#include "AppSettings.h"
#include "AirspaceManager.h"
#include "ADSBVehicleManager.h"
#include "QGCPalette.h"
#if defined(QGC_ENABLE_PAIRING)
#include "PairingManager.h"
#endif
...
...
@@ -81,6 +82,7 @@ public:
Q_PROPERTY
(
MicrohardManager
*
microhardManager
READ
microhardManager
CONSTANT
)
Q_PROPERTY
(
bool
microhardSupported
READ
microhardSupported
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)
Q_PROPERTY
(
PairingManager
*
pairingManager
READ
pairingManager
CONSTANT
)
#endif
...
...
@@ -280,6 +282,7 @@ private:
TaisyncManager
*
_taisyncManager
=
nullptr
;
MicrohardManager
*
_microhardManager
=
nullptr
;
ADSBVehicleManager
*
_adsbVehicleManager
=
nullptr
;
QGCPalette
*
_globalPalette
=
nullptr
;
#if defined(QGC_ENABLE_PAIRING)
PairingManager
*
_pairingManager
=
nullptr
;
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment