|
|
@ -12,6 +12,8 @@ |
|
|
|
/// @author Don Gagne <don@thegagnes.com>
|
|
|
|
/// @author Don Gagne <don@thegagnes.com>
|
|
|
|
|
|
|
|
|
|
|
|
#include "QGCPalette.h" |
|
|
|
#include "QGCPalette.h" |
|
|
|
|
|
|
|
#include "QGCApplication.h" |
|
|
|
|
|
|
|
#include "QGCCorePlugin.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <QApplication> |
|
|
|
#include <QApplication> |
|
|
|
#include <QPalette> |
|
|
|
#include <QPalette> |
|
|
@ -20,42 +22,16 @@ QList<QGCPalette*> QGCPalette::_paletteObjects; |
|
|
|
|
|
|
|
|
|
|
|
QGCPalette::Theme QGCPalette::_theme = QGCPalette::Dark; |
|
|
|
QGCPalette::Theme QGCPalette::_theme = QGCPalette::Dark; |
|
|
|
|
|
|
|
|
|
|
|
// Light Dark
|
|
|
|
QMap<int, QMap<int, QMap<QString, QColor>>> QGCPalette::_colorInfoMap; |
|
|
|
// Disabled Enabled Disabled Enabled
|
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(window, "#ffffff", "#ffffff", "#222222", "#222222") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(windowShade, "#d9d9d9", "#d9d9d9", "#333333", "#333333") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(windowShadeDark, "#bdbdbd", "#bdbdbd", "#282828", "#282828") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(text, "#9d9d9d", "#000000", "#a0a0a0", "#ffffff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(warningText, "#cc0808", "#cc0808", "#f85761", "#f85761") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(button, "#ffffff", "#ffffff", "#707070", "#626270") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(buttonText, "#9d9d9d", "#000000", "#202020", "#ffffff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(buttonHighlight, "#e4e4e4", "#946120", "#3a3a3a", "#fff291") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(buttonHighlightText, "#2c2c2c", "#ffffff", "#2c2c2c", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(primaryButton, "#585858", "#8cb3be", "#585858", "#8cb3be") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(primaryButtonText, "#2c2c2c", "#000000", "#2c2c2c", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(textField, "#ffffff", "#ffffff", "#585858", "#ffffff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(textFieldText, "#dedede", "#000000", "#2c2c2c", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(mapButton, "#585858", "#000000", "#585858", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(mapButtonHighlight, "#585858", "#be781c", "#585858", "#be781c") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorGreen, "#009431", "#009431", "#00e04b", "#00e04b") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorOrange, "#b95604", "#b95604", "#de8500", "#de8500") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorRed, "#ed3939", "#ed3939", "#f32836", "#f32836") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorGrey, "#808080", "#808080", "#bfbfbf", "#bfbfbf") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorBlue, "#1a72ff", "#1a72ff", "#536dff", "#536dff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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", "#48D6FF", "#48D6FF", "#48D6FF") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCPalette::QGCPalette(QObject* parent) : |
|
|
|
QGCPalette::QGCPalette(QObject* parent) : |
|
|
|
QObject(parent), |
|
|
|
QObject(parent), |
|
|
|
_colorGroupEnabled(true) |
|
|
|
_colorGroupEnabled(true) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (_colorInfoMap.isEmpty()) { |
|
|
|
|
|
|
|
_buildMap(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// We have to keep track of all QGCPalette objects in the system so we can signal theme change to all of them
|
|
|
|
// We have to keep track of all QGCPalette objects in the system so we can signal theme change to all of them
|
|
|
|
_paletteObjects += this; |
|
|
|
_paletteObjects += this; |
|
|
|
} |
|
|
|
} |
|
|
@ -67,6 +43,42 @@ QGCPalette::~QGCPalette() |
|
|
|
Q_UNUSED(fSuccess); |
|
|
|
Q_UNUSED(fSuccess); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QGCPalette::_buildMap(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Light Dark
|
|
|
|
|
|
|
|
// Disabled Enabled Disabled Enabled
|
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(window, "#ffffff", "#ffffff", "#222222", "#222222") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(windowShade, "#d9d9d9", "#d9d9d9", "#333333", "#333333") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(windowShadeDark, "#bdbdbd", "#bdbdbd", "#282828", "#282828") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(text, "#9d9d9d", "#000000", "#a0a0a0", "#ffffff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(warningText, "#cc0808", "#cc0808", "#f85761", "#f85761") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(button, "#ffffff", "#ffffff", "#707070", "#626270") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(buttonText, "#9d9d9d", "#000000", "#202020", "#ffffff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(buttonHighlight, "#e4e4e4", "#946120", "#3a3a3a", "#fff291") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(buttonHighlightText, "#2c2c2c", "#ffffff", "#2c2c2c", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(primaryButton, "#585858", "#8cb3be", "#585858", "#8cb3be") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(primaryButtonText, "#2c2c2c", "#000000", "#2c2c2c", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(textField, "#ffffff", "#ffffff", "#585858", "#ffffff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(textFieldText, "#dedede", "#000000", "#2c2c2c", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(mapButton, "#585858", "#000000", "#585858", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(mapButtonHighlight, "#585858", "#be781c", "#585858", "#be781c") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorGreen, "#009431", "#009431", "#00e04b", "#00e04b") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorOrange, "#b95604", "#b95604", "#de8500", "#de8500") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorRed, "#ed3939", "#ed3939", "#f32836", "#f32836") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorGrey, "#808080", "#808080", "#bfbfbf", "#bfbfbf") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(colorBlue, "#1a72ff", "#1a72ff", "#536dff", "#536dff") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(alertBackground, "#eecc44", "#eecc44", "#eecc44", "#eecc44") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(alertBorder, "#808080", "#808080", "#808080", "#808080") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(alertText, "#000000", "#000000", "#000000", "#000000") |
|
|
|
|
|
|
|
DECLARE_QGC_COLOR(missionItemEditor, "#585858", "#8cb3be", "#585858", "#8cb3be") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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", "#48D6FF", "#48D6FF", "#48D6FF") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void QGCPalette::setColorGroupEnabled(bool enabled) |
|
|
|
void QGCPalette::setColorGroupEnabled(bool enabled) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_colorGroupEnabled = enabled; |
|
|
|
_colorGroupEnabled = enabled; |
|
|
|