| 230 | } |
| 231 | |
| 232 | void NetHackQtLabelledIcon::resizeEvent(QResizeEvent*) |
| 233 | { |
| 234 | setAlignments(); |
| 235 | |
| 236 | //int labw=label ? label->fontMetrics().width(label->text()) : 0; |
| 237 | int labh=label ? label->fontMetrics().height() : 0; |
| 238 | int icoh=icon ? icon->height() : 0; |
| 239 | int h=icoh+labh; |
| 240 | int icoy=(h>height() ? height()-labh-icoh : height()/2-h/2); |
| 241 | int laby=icoy+icoh; |
| 242 | if (icon) { |
| 243 | icon->setGeometry(0,icoy,width(),icoh); |
| 244 | } |
| 245 | if (label) { |
| 246 | label->setGeometry(0,laby,width(),labh); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | void NetHackQtLabelledIcon::setAlignments() |
| 251 | { |