The previous implementation seemed to assume a full-screen main window - it will now open on the right side of the window, vertically centered, regardless of where the main window is.
Showing the changes to interface/src/Menu.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1206,12 +1206,12 @@ void Menu::showChat() { · 1205 unmodified lines | ||
| 1206 | 1206 | mainWindow->addDockWidget(Qt::NoDockWidgetArea, _chatWindow = new ChatWindow()); |
| 1207 | 1207 | } |
| 1208 | 1208 | if (!_chatWindow->toggleViewAction()->isChecked()) { |
| 1209 | − int width = _chatWindow->width(); | |
| 1210 | − int y = qMax((mainWindow->height() - _chatWindow->height()) / 2, 0); | |
| 1211 | − _chatWindow->move(mainWindow->width(), y); | |
| 1209 | + const QRect& windowGeometry = mainWindow->geometry(); | |
| 1210 | + _chatWindow->move(windowGeometry.topRight().x() - _chatWindow->width(), | |
| 1211 | + windowGeometry.topRight().y() + (windowGeometry.height() / 2) - (_chatWindow->height() / 2)); | |
| 1212 | + | |
| 1212 | 1213 | _chatWindow->resize(0, _chatWindow->height()); |
| 1213 | 1214 | _chatWindow->toggleViewAction()->trigger(); |
| 1214 | − | |
| 1215 | 1215 | } |
| 1216 | 1216 | } |
| 1217 | 1217 | |