From 6d4fd933b265ca64a3046205afd9d960795b6b5c Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 22 Nov 2020 01:10:52 -0800 Subject: [PATCH] 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. --- win/Qt/qt_icon.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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)