| 257 | } |
| 258 | |
| 259 | QSize NetHackQtInvUsageWindow::sizeHint(void) const |
| 260 | { |
| 261 | if (qt_settings) { |
| 262 | int w = 0, h = 1; // one pixel margin at top |
| 263 | // 1+X+1: one pixel border surrounding each tile in the paper doll, |
| 264 | // so +1 left and +1 right, also +1 above and +1 below |
| 265 | #ifdef ENHANCED_PAPERDOLL |
| 266 | if (iflags.wc_ascii_map) |
| 267 | qt_settings->doll_is_shown = false; |
| 268 | if (qt_settings->doll_is_shown) { |
| 269 | w += (1 + qt_settings->dollWidth + 1) * 3; |
| 270 | h += (1 + qt_settings->dollHeight + 1) * 6; |
| 271 | } |
| 272 | #else |
| 273 | if (iflags.wc_tiled_map) { |
| 274 | w += (1 + qt_settings->glyphs().width() + 1) * 3; |
| 275 | h += (1 + qt_settings->glyphs().height() + 1) * 6; |
| 276 | } |
| 277 | #endif |
| 278 | return QSize(w, h); |
| 279 | } else { |
| 280 | return QWidget::sizeHint(); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | // ENHANCED_PAPERDOLL - called when a tool tip is triggered by hovering mouse |
| 285 | bool NetHackQtInvUsageWindow::tooltip_event(QHelpEvent *tipevent) |