4#include <QtCore/QDebug>
6QList<QGCPalette*> QGCPalette::_paletteObjects;
10QMap<int, QMap<int, QMap<QString, QColor>>> QGCPalette::_colorInfoMap;
12QStringList QGCPalette::_colors;
16 _colorGroupEnabled(true)
18 if (_colorInfoMap.isEmpty()) {
23 _paletteObjects +=
this;
28 bool fSuccess = _paletteObjects.removeOne(
this);
30 qWarning() <<
"Internal error";
34void QGCPalette::_buildMap()
39 DECLARE_QGC_COLOR(windowTransparent, "
#ccffffff", "#ccffffff", "#cc222222", "#cc222222")
40 DECLARE_QGC_COLOR(windowShadeLight, "#909090", "#828282", "#707070", "#626262")
41 DECLARE_QGC_COLOR(windowShade, "#d9d9d9", "#d9d9d9", "#333333", "#333333")
42 DECLARE_QGC_COLOR(windowShadeDark, "#bdbdbd", "#bdbdbd", "#282828", "#282828")
43 DECLARE_QGC_COLOR(text, "#9d9d9d", "#333333", "#707070", "#ffffff")
44 DECLARE_QGC_COLOR(windowTransparentText,"#9d9d9d", "#000000", "#707070", "#ffffff")
45 DECLARE_QGC_COLOR(warningText, "#cc0808", "#cc0808", "#f85761", "#f85761")
46 DECLARE_QGC_COLOR(button, "#ffffff", "#ffffff", "#707070", "#626270")
47 DECLARE_QGC_COLOR(buttonBorder, "#9d9d9d", "#3A9BDC", "#707070", "#adadb8")
48 DECLARE_QGC_COLOR(buttonText, "#9d9d9d", "#333333", "#A6A6A6", "#ffffff")
49 DECLARE_QGC_COLOR(buttonHighlight, "#e4e4e4", "#3A9BDC", "#3a3a3a", "#3A9BDC")
50 DECLARE_QGC_COLOR(buttonHighlightText, "#2c2c2c", "#ffffff", "#2c2c2c", "#ffffff")
51 DECLARE_QGC_COLOR(primaryButton, "#585858", "#8cb3be", "#585858", "#8cb3be")
52 DECLARE_QGC_COLOR(primaryButtonText, "#2c2c2c", "#333333", "#2c2c2c", "#000000")
53 DECLARE_QGC_COLOR(textField, "#ffffff", "#ffffff", "#707070", "#ffffff")
54 DECLARE_QGC_COLOR(textFieldText, "#808080", "#333333", "#000000", "#000000")
55 DECLARE_QGC_COLOR(mapButton, "#585858", "#333333", "#585858", "#000000")
56 DECLARE_QGC_COLOR(mapButtonHighlight, "#585858", "#be781c", "#585858", "#be781c")
57 DECLARE_QGC_COLOR(mapIndicator, "#585858", "#be781c", "#585858", "#be781c")
58 DECLARE_QGC_COLOR(mapIndicatorChild, "#585858", "#766043", "#585858", "#766043")
59 DECLARE_QGC_COLOR(colorGreen, "#008f2d", "#008f2d", "#00e04b", "#00e04b")
60 DECLARE_QGC_COLOR(colorYellow, "#a2a200", "#a2a200", "#ffff00", "#ffff00")
61 DECLARE_QGC_COLOR(colorYellowGreen, "#799f26", "#799f26", "#9dbe2f", "#9dbe2f")
62 DECLARE_QGC_COLOR(colorOrange, "#bf7539", "#bf7539", "#de8500", "#de8500")
63 DECLARE_QGC_COLOR(colorRed, "#b52b2b", "#b52b2b", "#f32836", "#f32836")
64 DECLARE_QGC_COLOR(colorGrey, "#808080", "#808080", "#bfbfbf", "#bfbfbf")
65 DECLARE_QGC_COLOR(colorBlue, "#1a72ff", "#1a72ff", "#536dff", "#536dff")
66 DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44")
67 DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080")
68 DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000")
69 DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#dbfef8", "#585858", "#585d83")
70 DECLARE_QGC_COLOR(toolStripHoverColor, "#585858", "#9D9D9D", "#585858", "#585d83")
71 DECLARE_QGC_COLOR(statusFailedText, "#9d9d9d", "#000000", "#707070", "#ffffff")
72 DECLARE_QGC_COLOR(statusPassedText, "#9d9d9d", "#000000", "#707070", "#ffffff")
73 DECLARE_QGC_COLOR(statusPendingText, "#9d9d9d", "#000000", "#707070", "#ffffff")
74 DECLARE_QGC_COLOR(toolbarBackground, "#00ffffff", "#00ffffff", "#00222222", "#00222222")
75 DECLARE_QGC_COLOR(groupBorder, "#bbbbbb", "#3A9BDC", "#707070", "#707070")
77 // Colors not affecting by theming
79 DECLARE_QGC_NONTHEMED_COLOR(brandingPurple, "#4A2C6D", "#4A2C6D")
80 DECLARE_QGC_NONTHEMED_COLOR(brandingBlue, "#48D6FF", "#6045c5")
81 DECLARE_QGC_NONTHEMED_COLOR(toolStripFGColor, "#707070", "#ffffff")
82 DECLARE_QGC_NONTHEMED_COLOR(photoCaptureButtonColor, "#707070", "#ffffff")
83 DECLARE_QGC_NONTHEMED_COLOR(videoCaptureButtonColor, "#f89a9e", "#f32836")
85 // Colors not affecting by theming or enable/disable
86 DECLARE_QGC_SINGLE_COLOR(mapWidgetBorderLight, "#ffffff")
87 DECLARE_QGC_SINGLE_COLOR(mapWidgetBorderDark, "#000000")
88 DECLARE_QGC_SINGLE_COLOR(mapMissionTrajectory, "#be781c")
89 DECLARE_QGC_SINGLE_COLOR(surveyPolygonInterior, "green")
90 DECLARE_QGC_SINGLE_COLOR(surveyPolygonTerrainCollision, "red")
94void QGCPalette::setColorGroupEnabled(bool enabled)
96 _colorGroupEnabled = enabled;
97 emit paletteChanged();
100void QGCPalette::setGlobalTheme(Theme newTheme)
102 // Mobile build does not have themes
103 if (_theme != newTheme) {
105 _signalPaletteChangeToAll();
109void QGCPalette::_signalPaletteChangeToAll()
111 // Notify all objects of the new theme
112 for (QGCPalette *palette : std::as_const(_paletteObjects)) {
113 palette->_signalPaletteChanged();
117void QGCPalette::_signalPaletteChanged()
119 emit paletteChanged();
#define DECLARE_QGC_COLOR(name, lightDisabled, lightEnabled, darkDisabled, darkEnabled)
QGCPalette(QObject *parent=nullptr)