Qt status bit

When Qt highlights a field that has gotten better, use the same
shade of green as is used for the green range of hitpoint bar.
The old value was too dull, like olive green seen in shadow.
This commit is contained in:
PatR
2020-11-22 01:10:52 -08:00
parent f43421ae3c
commit 6d4fd933b2
+10 -4
View File
@@ -62,12 +62,18 @@ NetHackQtLabelledIcon::NetHackQtLabelledIcon(QWidget *parent, const char *l,
initHighlight(); initHighlight();
} }
// set up the style sheet strings used to specify color for status field
// labels [done "once", but once for each LabelledIcon that's constucted,
// so more than 20 copies overall]
void NetHackQtLabelledIcon::initHighlight() void NetHackQtLabelledIcon::initHighlight()
{ {
// note: string "green" is much darker than Qt::green // note: string "green" is much darker than enum Qt::green
hl_better = "QLabel { background-color : green ; color : white }"; // QColor("green") => #00ff00
hl_worse = "QLabel { background-color : red ; color : white }"; // QColor(Qt::green) => #008000
hl_changd = "QLabel { background-color : blue ; color : white }"; // QColor("green").lighter(150) => #00c000 /* hitpoint bar's green */
hl_better = "QLabel { background-color : #00c000 ; color : white }";
hl_worse = "QLabel { background-color : red ; color : white }";
hl_changd = "QLabel { background-color : blue ; color : white }";
} }
void NetHackQtLabelledIcon::setLabel(const QString &t, bool lower) void NetHackQtLabelledIcon::setLabel(const QString &t, bool lower)