mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
Update chat menu to properly position itself when opening
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.
This commit is contained in:
parent
5099a0e061
commit
2d481dda4e
1 changed files with 4 additions and 4 deletions
|
@ -1206,12 +1206,12 @@ void Menu::showChat() {
|
|||
mainWindow->addDockWidget(Qt::NoDockWidgetArea, _chatWindow = new ChatWindow());
|
||||
}
|
||||
if (!_chatWindow->toggleViewAction()->isChecked()) {
|
||||
int width = _chatWindow->width();
|
||||
int y = qMax((mainWindow->height() - _chatWindow->height()) / 2, 0);
|
||||
_chatWindow->move(mainWindow->width(), y);
|
||||
const QRect& windowGeometry = mainWindow->geometry();
|
||||
_chatWindow->move(windowGeometry.topRight().x() - _chatWindow->width(),
|
||||
windowGeometry.topRight().y() + (windowGeometry.height() / 2) - (_chatWindow->height() / 2));
|
||||
|
||||
_chatWindow->resize(0, _chatWindow->height());
|
||||
_chatWindow->toggleViewAction()->trigger();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue