Commit b80a810a authored by Gus Grubba's avatar Gus Grubba

Adding alert message colors

parent d5e12680
......@@ -137,6 +137,21 @@ QColor QGCPalette::_colorBlue[QGCPalette::_cThemes][QGCPalette::_cColorGroups] =
{ 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) },
};
QGCPalette::QGCPalette(QObject* parent) :
QObject(parent),
_colorGroupEnabled(true)
......
......@@ -66,6 +66,10 @@ class QGCPalette : public QObject
Q_PROPERTY(QColor colorGrey READ colorGrey WRITE setColorGrey NOTIFY paletteChanged)
Q_PROPERTY(QColor colorBlue READ colorBlue WRITE setColorBlue NOTIFY paletteChanged)
Q_PROPERTY(QColor alertBackground READ alertBackground WRITE setAlertBackground NOTIFY paletteChanged)
Q_PROPERTY(QColor alertBorder READ alertBorder WRITE setAlertBorder NOTIFY paletteChanged)
Q_PROPERTY(QColor alertText READ alertText WRITE setAlertText NOTIFY paletteChanged)
public:
enum ColorGroup {
Disabled = 0,
......@@ -148,6 +152,11 @@ public:
QColor colorGrey () const { return _colorGrey[_theme][_colorGroupEnabled ? 1 : 0]; }
QColor colorBlue () const { return _colorBlue[_theme][_colorGroupEnabled ? 1 : 0]; }
/// Alert and important message dialogs
QColor alertBackground () const { return _alertBackground[_theme][_colorGroupEnabled ? 1 : 0]; }
QColor alertBorder () const { return _alertBorder[_theme][_colorGroupEnabled ? 1 : 0]; }
QColor alertText () const { return _alertText[_theme][_colorGroupEnabled ? 1 : 0]; }
void setWindow(QColor& color) { _window[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
void setWindowShade(QColor& color) { _windowShade[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
void setWindowShadeDark(QColor& color) { _windowShadeDark[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
......@@ -172,6 +181,10 @@ public:
void setColorGrey (QColor& color) { _colorGrey[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
void setColorBlue (QColor& color) { _colorBlue[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
void setAlertBackground (QColor& color) { _alertBackground[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
void setAlertBorder (QColor& color) { _alertBorder[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
void setAlertText (QColor& color) { _alertText[_theme][_colorGroupEnabled ? 1 : 0] = color; _signalPaletteChangeToAll(); }
static Theme globalTheme(void) { return _theme; }
static void setGlobalTheme(Theme newTheme);
......@@ -222,6 +235,10 @@ private:
static QColor _colorGrey[_cThemes][_cColorGroups];
static QColor _colorBlue[_cThemes][_cColorGroups];
static QColor _alertBackground[_cThemes][_cColorGroups];
static QColor _alertBorder[_cThemes][_cColorGroups];
static QColor _alertText[_cThemes][_cColorGroups];
void _themeChanged(void);
static QList<QGCPalette*> _paletteObjects; ///< List of all active QGCPalette objects
......
This diff is collapsed.
......@@ -429,13 +429,13 @@ Item {
id: criticalMmessageArea
width: mainWindow.width * 0.55
height: Math.min(criticalMessageText.height + _textMargins * 2, ScreenTools.defaultFontPixelHeight * 6)
color: "#eecc44"
color: qgcPal.alertBackground
visible: false
radius: ScreenTools.defaultFontPixelHeight * 0.5
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: toolBar.height + ScreenTools.defaultFontPixelHeight / 2
border.color: "#808080"
border.color: qgcPal.alertBorder
border.width: 2
readonly property real _textMargins: ScreenTools.defaultFontPixelHeight
......@@ -484,7 +484,7 @@ Item {
font.pointSize: ScreenTools.defaultFontPointSize
font.family: ScreenTools.demiboldFontFamily
wrapMode: TextEdit.WordWrap
color: "black"
color: qgcPal.alertText
}
}
......@@ -499,7 +499,7 @@ Item {
sourceSize.height: width
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
color: "black"
color: qgcPal.alertText
MouseArea {
anchors.fill: parent
anchors.margins: ScreenTools.isMobile ? -ScreenTools.defaultFontPixelHeight : 0
......@@ -520,7 +520,7 @@ Item {
source: "/res/ArrowDown.svg"
fillMode: Image.PreserveAspectFit
visible: criticalMessageText.lineCount > 5
color: "black"
color: qgcPal.alertText
MouseArea {
anchors.fill: parent
onClicked: {
......
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