Showing the changes to interface/src/Menu.cpp (1 of 40 files). Show all
Unified · Split
| @@ -1062,15 +1062,10 @@ void Menu::showChat() { · 1061 unmodified lines | |||
| 1062 | if (!_chatWindow) { | 1062 | if (!_chatWindow) { |
| 1063 | _chatWindow = new ChatWindow(); | 1063 | _chatWindow = new ChatWindow(); |
| 1064 | QMainWindow* mainWindow = Application::getInstance()->getWindow(); | 1064 | QMainWindow* mainWindow = Application::getInstance()->getWindow(); |
| 1065 | |||
| 1066 | // the height of the title bar is given by frameGeometry().height() - geometry().height() | ||
| 1067 | // however, frameGeometry() is initialised after showing (Qt queries the OS windowing system) | ||
| 1068 | // on the other hand, moving a window after showing it flickers; so just use some reasonable value | ||
| 1069 | int titleBarHeight = 16; | ||
| 1070 | _chatWindow->setGeometry(mainWindow->width() - _chatWindow->width(), | 1065 | _chatWindow->setGeometry(mainWindow->width() - _chatWindow->width(), |
| 1071 | mainWindow->geometry().y() + titleBarHeight, | 1066 | mainWindow->geometry().y(), |
| 1072 | _chatWindow->width(), | 1067 | _chatWindow->width(), |
| 1073 | mainWindow->height() - titleBarHeight); | 1068 | mainWindow->height()); |
| 1074 | _chatWindow->show(); | 1069 | _chatWindow->show(); |
| 1075 | } | 1070 | } |
| 1076 | _chatWindow->raise(); | 1071 | _chatWindow->raise(); |
| @@ -1114,6 +1109,40 @@ void Menu::octreeStatsDetailsClosed() { · 37 unmodified lines | |||
| 1114 | } | 1109 | } |
| 1115 | } | 1110 | } |
| 1116 | 1111 | ||
| 1112 | QString Menu::getLODFeedbackText() { | ||
| 1113 | // determine granularity feedback | ||
| 1114 | int boundaryLevelAdjust = getBoundaryLevelAdjust(); | ||
| 1115 | QString granularityFeedback; | ||
| 1116 | |||
| 1117 | switch (boundaryLevelAdjust) { | ||
| 1118 | case 0: { | ||
| 1119 | granularityFeedback = QString("at standard granularity."); | ||
| 1120 | } break; | ||
| 1121 | case 1: { | ||
| 1122 | granularityFeedback = QString("at half of standard granularity."); | ||
| 1123 | } break; | ||
| 1124 | case 2: { | ||
| 1125 | granularityFeedback = QString("at a third of standard granularity."); | ||
| 1126 | } break; | ||
| 1127 | default: { | ||
| 1128 | granularityFeedback = QString("at 1/%1th of standard granularity.").arg(boundaryLevelAdjust + 1); | ||
| 1129 | } break; | ||
| 1130 | } | ||
| 1131 | |||
| 1132 | // distance feedback | ||
| 1133 | float voxelSizeScale = getVoxelSizeScale(); | ||
| 1134 | float relativeToDefault = voxelSizeScale / DEFAULT_OCTREE_SIZE_SCALE; | ||
| 1135 | QString result; | ||
| 1136 | if (relativeToDefault > 1.01) { | ||
| 1137 | result = QString("%1 further %2").arg(relativeToDefault,8,'f',2).arg(granularityFeedback); | ||
| 1138 | } else if (relativeToDefault > 0.99) { | ||
| 1139 | result = QString("the default distance %1").arg(granularityFeedback); | ||
| 1140 | } else { | ||
| 1141 | result = QString("%1 of default %2").arg(relativeToDefault,8,'f',3).arg(granularityFeedback); | ||
| 1142 | } | ||
| 1143 | return result; | ||
| 1144 | } | ||
| 1145 | |||
| 1117 | void Menu::autoAdjustLOD(float currentFPS) { | 1146 | void Menu::autoAdjustLOD(float currentFPS) { |
| 1118 | // NOTE: our first ~100 samples at app startup are completely all over the place, and we don't | 1147 | // NOTE: our first ~100 samples at app startup are completely all over the place, and we don't |
| 1119 | // really want to count them in our average, so we will ignore the real frame rates and stuff | 1148 | // really want to count them in our average, so we will ignore the real frame rates and stuff |