Commit 7ab6707e authored by Gus Grubba's avatar Gus Grubba

Adding macros for color definition.

parent b80a810a
......@@ -20,137 +20,37 @@ QList<QGCPalette*> QGCPalette::_paletteObjects;
QGCPalette::Theme QGCPalette::_theme = QGCPalette::Dark;
QColor QGCPalette::_window[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#ffffff"), QColor("#ffffff") },
{ QColor(0x22, 0x22, 0x22), QColor(0x22, 0x22, 0x22) }
};
QColor QGCPalette::_windowShade[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#d9d9d9"), QColor("#d9d9d9") },
{ QColor(51, 51, 51), QColor(51, 51, 51) }
};
QColor QGCPalette::_windowShadeDark[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#bdbdbd"), QColor("#bdbdbd") },
{ QColor(40, 40, 40), QColor(40, 40, 40) }
};
QColor QGCPalette::_text[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#9d9d9d"), QColor("#000000") },
{ QColor(0x58, 0x58, 0x58), QColor(0xFF, 0xFF, 0xFF) }
};
QColor QGCPalette::_warningText[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#cc0808"), QColor("#cc0808") },
{ QColor("#f85761"), QColor("#f85761") }
};
QColor QGCPalette::_button[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#ffffff"), QColor("#ffffff") },
{ QColor(0x58, 0x58, 0x58), QColor(98, 98, 100) },
};
QColor QGCPalette::_buttonText[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#9d9d9d"), QColor("#000000") },
{ QColor(0x2c, 0x2c, 0x2c), QColor(0xFF, 0xFF, 0xFF) },
};
QColor QGCPalette::_buttonHighlight[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#e4e4e4"), QColor("#946120") },
{ QColor(0x58, 0x58, 0x58), QColor("#fff291") },
};
QColor QGCPalette::_buttonHighlightText[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(0x2c, 0x2c, 0x2c), QColor("#ffffff") },
{ QColor(0x2c, 0x2c, 0x2c), QColor(0, 0, 0) },
};
QColor QGCPalette::_primaryButton[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(0x58, 0x58, 0x58), QColor("#8cb3be") },
{ QColor(0x58, 0x58, 0x58), QColor("#8cb3be") },
};
QColor QGCPalette::_primaryButtonText[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(0x2c, 0x2c, 0x2c), QColor(0, 0, 0) },
{ QColor(0x2c, 0x2c, 0x2c), QColor(0, 0, 0) },
};
QColor QGCPalette::_textField[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#ffffff"), QColor("#ffffff") },
{ QColor(0x58, 0x58, 0x58), QColor(255, 255, 255) },
};
QColor QGCPalette::_textFieldText[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#dedede"), QColor("#000000") },
{ QColor(0x2c, 0x2c, 0x2c), QColor(0, 0, 0) },
};
QColor QGCPalette::_mapButton[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(0x58, 0x58, 0x58), QColor(0, 0, 0) },
{ QColor(0x58, 0x58, 0x58), QColor(0, 0, 0) },
};
QColor QGCPalette::_mapButtonHighlight[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(0x58, 0x58, 0x58), QColor(190, 120, 28) },
{ QColor(0x58, 0x58, 0x58), QColor(190, 120, 28) },
};
// Map widget colors are not affecting by theming
QColor QGCPalette::_mapWidgetBorderLight[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(255, 255, 255), QColor(255, 255, 255) },
{ QColor(255, 255, 255), QColor(255, 255, 255) },
};
QColor QGCPalette::_mapWidgetBorderDark[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(0, 0, 0), QColor(0, 0, 0) },
{ QColor(0, 0, 0), QColor(0, 0, 0) },
};
QColor QGCPalette::_brandingPurple[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#4A2C6D"), QColor("#4A2C6D") },
{ QColor("#4A2C6D"), QColor("#4A2C6D") },
};
QColor QGCPalette::_brandingBlue[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#48D6FF"), QColor("#48D6FF") },
{ QColor("#48D6FF"), QColor("#48D6FF") },
};
QColor QGCPalette::_colorGreen[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#009431"), QColor("#009431") }, //-- Light
{ QColor("#00e04b"), QColor("#00e04b") }, //-- Dark
};
QColor QGCPalette::_colorOrange[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#b95604"), QColor("#b95604") },
{ QColor("#de8500"), QColor("#de8500") },
};
QColor QGCPalette::_colorRed[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#ed3939"), QColor("#ed3939") },
{ QColor("#f32836"), QColor("#f32836") },
};
QColor QGCPalette::_colorGrey[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#808080"), QColor("#808080") },
{ QColor("#bfbfbf"), QColor("#bfbfbf") },
};
QColor QGCPalette::_colorBlue[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#1a72ff"), QColor("#1a72ff") },
{ QColor("#536dff"), QColor("#536dff") },
};
QColor QGCPalette::_alertBackground[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#eecc44"), QColor("#eecc44") },
{ QColor("#eecc44"), QColor("#eecc44") },
};
QColor QGCPalette::_alertBorder[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor("#808080"), QColor("#808080") },
{ QColor("#808080"), QColor("#808080") },
};
QColor QGCPalette::_alertText[QGCPalette::_cThemes][QGCPalette::_cColorGroups] = {
{ QColor(0,0,0), QColor(0,0,0) },
{ QColor(0,0,0), QColor(0,0,0) },
};
// 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", "#3a3a3a", "#ffffff")
DECLARE_QGC_COLOR(warningText, "#cc0808", "#cc0808", "#f85761", "#f85761")
DECLARE_QGC_COLOR(button, "#ffffff", "#ffffff", "#606060", "#626270")
DECLARE_QGC_COLOR(buttonText, "#9d9d9d", "#000000", "#2c2c2c", "#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) :
QObject(parent),
......@@ -182,7 +82,7 @@ void QGCPalette::setGlobalTheme(Theme newTheme)
}
}
void QGCPalette::_signalPaletteChangeToAll(void)
void QGCPalette::_signalPaletteChangeToAll()
{
// Notify all objects of the new theme
foreach (QGCPalette* palette, _paletteObjects) {
......@@ -190,8 +90,7 @@ void QGCPalette::_signalPaletteChangeToAll(void)
}
}
void QGCPalette::_signalPaletteChanged(void)
void QGCPalette::_signalPaletteChanged()
{
emit paletteChanged();
}
This diff is collapsed.
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