Commit 12442206 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

color for errors

parent 7460bccd
...@@ -91,20 +91,19 @@ void AlarmTreeWidgetItem::update(const QStringList &fields) ...@@ -91,20 +91,19 @@ void AlarmTreeWidgetItem::update(const QStringList &fields)
field = QDateTime::fromTime_t(field.toUInt()).toString(); field = QDateTime::fromTime_t(field.toUInt()).toString();
if(text(i) != field) if(text(i) != field)
setText(i, field); setText(i, field);
if(colorField.contains("ALARM")) { if(colorField.contains("ALARM") || colorField.contains("ERROR")) {
int l = colorField.contains("ERROR") ? 130 : 140;
int d = colorField.contains("ERROR") ? l * 1.4 : l * 0.85;
if(levelField == "highest") if(levelField == "highest")
setBackground(i, QColor("DarkRed").lighter()); setBackground(i, QColor("Red").lighter(i != Status ? l * 0.85 : d * 0.95));
else if(levelField == "high") else if(levelField == "high")
setBackground(i, QColor("Red").lighter()); setBackground(i, QColor("Red").lighter(i != Status ? l : d));
else if(levelField == "medium") else if(levelField == "medium")
setBackground(i, QColor("OrangeRed").lighter()); setBackground(i, QColor("OrangeRed").lighter(i != Status ? l : d));
else if(levelField == "low") else if(levelField == "low")
setBackground(i, QColor("Orange").lighter()); setBackground(i, QColor("Orange").lighter(i != Status ? l : d));
else if(levelField == "lowest") else if(levelField == "lowest")
setBackground(i, QColor("yellow").lighter()); setBackground(i, QColor("yellow").lighter(i != Status ? l : d));
}
else if(colorField.contains("ERROR")) {
setBackground(i, QColor("Red").lighter(140));
} }
else else
{ {
......
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