| 1083 | } |
| 1084 | |
| 1085 | void NetHackQtTextWindow::Display(bool block UNUSED) |
| 1086 | { |
| 1087 | // make sure window isn't completely empty |
| 1088 | if (!lines->count()) |
| 1089 | PutStr(ATR_NONE, ""); |
| 1090 | |
| 1091 | if (str_fixed) { |
| 1092 | lines->setFont(qt_settings->normalFixedFont()); |
| 1093 | } else { |
| 1094 | lines->setFont(qt_settings->normalFont()); |
| 1095 | } |
| 1096 | |
| 1097 | /* int h=0; */ |
| 1098 | if (use_rip) { |
| 1099 | /* h+=rip.height(); */ |
| 1100 | (void) rip.height(); |
| 1101 | ok.hide(); |
| 1102 | search.hide(); |
| 1103 | rip.show(); |
| 1104 | } else { |
| 1105 | /* h+=ok.height()*2 + 7; */ |
| 1106 | (void) ok.height(); |
| 1107 | ok.show(); |
| 1108 | search.show(); |
| 1109 | rip.hide(); |
| 1110 | } |
| 1111 | #if QT_VERSION < 0x060000 |
| 1112 | QSize screensize = QApplication::desktop()->size(); |
| 1113 | #else |
| 1114 | QSize screensize = screen()->size(); |
| 1115 | #endif |
| 1116 | int mh = screensize.height()*3/5; |
| 1117 | if ( (qt_compact_mode && lines->TotalHeight() > mh) || use_rip ) { |
| 1118 | showNormal(); |
| 1119 | } else { |
| 1120 | move(0, 0); |
| 1121 | adjustSize(); |
| 1122 | centerOnMain(this); |
| 1123 | show(); |
| 1124 | } |
| 1125 | |
| 1126 | lines->clearSelection(); // affects [Search] |
| 1127 | |
| 1128 | exec(); |
| 1129 | textsearching = false; |
| 1130 | } |
| 1131 | |
| 1132 | // handle a line of text for a text window |
| 1133 | void NetHackQtTextWindow::PutStr(int attr UNUSED, const QString& text) |
nothing calls this directly
no test coverage detected