Qt: add tool tips for status window icons
Show a tip if the mouse hovers over any of the various icons displayed in the status window (for one each of the six characteristics, another for alignment, and one for each status condition). They all already have text labels below but many of those are abbreviated; the tips can be more verbose since they don't compete with each for for screen space. Also fixes "weak" not being centered under the hunger icon. It /was/ centered but invisible trailing spaces made the visible text be shifted to the left.
This commit is contained in:
@@ -118,11 +118,15 @@ void NetHackQtLabelledIcon::setLabel(const QString& t, long v,
|
||||
setLabel(t,v,v,tail);
|
||||
}
|
||||
|
||||
void NetHackQtLabelledIcon::setIcon(const QPixmap& i)
|
||||
void NetHackQtLabelledIcon::setIcon(
|
||||
const QPixmap& i,
|
||||
const QString& tooltip)
|
||||
{
|
||||
if (!icon)
|
||||
icon = new QLabel(this);
|
||||
icon->setPixmap(i);
|
||||
if (!tooltip.isNull() && !tooltip.isEmpty())
|
||||
icon->setToolTip(" " + tooltip + " ");
|
||||
ForceResize();
|
||||
icon->resize(i.width(), i.height());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user