| 1371 | } |
| 1372 | |
| 1373 | void NetHackQtStringRequestor::resizeEvent(QResizeEvent*) |
| 1374 | { |
| 1375 | const int margin=5; |
| 1376 | const int gutter=5; |
| 1377 | |
| 1378 | int h=(height()-margin*2-gutter); |
| 1379 | |
| 1380 | if (strlen(prompt.text()) > 16) { |
| 1381 | h/=3; |
| 1382 | prompt.setGeometry(margin,margin,width()-margin*2,h); |
| 1383 | input.setGeometry(width()*1/5,margin+h+gutter, |
| 1384 | (width()-margin-2-gutter)*4/5,h); |
| 1385 | } else { |
| 1386 | h/=2; |
| 1387 | prompt.setGeometry(margin,margin,(width()-margin*2-gutter)*2/5,h); |
| 1388 | input.setGeometry(prompt.geometry().right()+gutter,margin, |
| 1389 | (width()-margin-2-gutter)*3/5,h); |
| 1390 | } |
| 1391 | |
| 1392 | cancel->setGeometry(margin,input.geometry().bottom()+gutter, |
| 1393 | (width()-margin*2-gutter)/2,h); |
| 1394 | okay->setGeometry(cancel->geometry().right()+gutter,cancel->geometry().y(), |
| 1395 | cancel->width(),h); |
| 1396 | } |
| 1397 | |
| 1398 | void NetHackQtStringRequestor::SetDefault(const char* d) |
| 1399 | { |