MCPcopy Create free account
hub / github.com/NetHack/NetHack / resizeEvent

Method resizeEvent

outdated/win/Qt3/qt3_win.cpp:1373–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1371}
1372
1373void 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
1398void NetHackQtStringRequestor::SetDefault(const char* d)
1399{

Callers

nothing calls this directly

Calls 2

widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected