| 78 | } |
| 79 | |
| 80 | void NetHackQtLabelledIcon::setLabel(const QString &t, bool lower) |
| 81 | { |
| 82 | if (!label) { |
| 83 | label=new QLabel(this); |
| 84 | label->setFont(font()); |
| 85 | } |
| 86 | if (label->text() != t) { |
| 87 | label->setText(t); |
| 88 | ForceResize(); |
| 89 | if (comp_mode != NoCompare) { |
| 90 | highlight((comp_mode == NeitherIsBetter) ? hl_changd |
| 91 | : (comp_mode == (lower ? SmallerIsBetter |
| 92 | : BiggerIsBetter)) ? hl_better |
| 93 | : hl_worse); |
| 94 | } else if (turn_count) { |
| 95 | // if we don't want to highlight this status field but it is |
| 96 | // currently highlighted (perhaps optional Score recently went |
| 97 | // up and has just been toggled off), remove the highlight |
| 98 | unhighlight(); |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | void NetHackQtLabelledIcon::setLabel(const QString& t, long v, long cv, |
| 104 | const QString& tail) |
no test coverage detected