From: PatR Date: Sun, 22 Nov 2020 09:10:52 +0000 (-0800) Subject: Qt status bit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d4fd933b265ca64a3046205afd9d960795b6b5c;p=nethack 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. --- diff --git a/win/Qt/qt_icon.cpp b/win/Qt/qt_icon.cpp index 19763cffb..b32ac0d9a 100644 --- a/win/Qt/qt_icon.cpp +++ b/win/Qt/qt_icon.cpp @@ -62,12 +62,18 @@ NetHackQtLabelledIcon::NetHackQtLabelledIcon(QWidget *parent, const char *l, 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() { - // note: string "green" is much darker than Qt::green - hl_better = "QLabel { background-color : green ; color : white }"; - hl_worse = "QLabel { background-color : red ; color : white }"; - hl_changd = "QLabel { background-color : blue ; color : white }"; + // note: string "green" is much darker than enum Qt::green + // QColor("green") => #00ff00 + // QColor(Qt::green) => #008000 + // 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)