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

Method resizeEvent

win/Qt/qt_streq.cpp:47–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void NetHackQtStringRequestor::resizeEvent(QResizeEvent*)
48{
49 const int margin=5;
50 const int gutter=5;
51
52 int h = (height() - margin * 2 - gutter);
53 int w = (width() - margin * 2 - gutter);
54 int ifw = input.hasFrame() ? 3 : 0; // hack alert for input.frameWidth()
55 if (prompt.text().size() > 16) {
56 h /= 3;
57 prompt.setGeometry(margin + ifw * 2 + 1, margin, w + gutter, h);
58 input.setGeometry(width() * 1 / 5 - ifw, margin + h + gutter,
59 w * 4 / 5, h);
60 } else {
61 h /= 2;
62 prompt.setGeometry(margin + ifw * 2 + 1, margin, w * 2 / 5, h);
63 input.setGeometry(prompt.geometry().right() + gutter
64 - (ifw * 2 + 1) - ifw * 2,
65 margin, w * 3 / 5, h);
66 }
67
68 cancel->setGeometry(margin, input.geometry().bottom() + gutter, w / 2, h);
69 okay->setGeometry(cancel->geometry().right() + gutter,
70 cancel->geometry().y(), w / 2, h);
71}
72
73void NetHackQtStringRequestor::SetDefault(const char *d)
74{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected