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

Method Display

win/Qt/qt_menu.cpp:1085–1130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1083}
1084
1085void 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
1133void NetHackQtTextWindow::PutStr(int attr UNUSED, const QString& text)

Callers

nothing calls this directly

Calls 6

countMethod · 0.80
centerOnMainFunction · 0.70
setFontMethod · 0.45
heightMethod · 0.45
showMethod · 0.45
TotalHeightMethod · 0.45

Tested by

no test coverage detected