| 45 | } |
| 46 | |
| 47 | void 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 | |
| 73 | void NetHackQtStringRequestor::SetDefault(const char *d) |
| 74 | { |
nothing calls this directly
no outgoing calls
no test coverage detected