Use frame geo rather than widget size, so dialogs aren't positioned off screen on Windows.

pull/1852/head
srcejon 2023-09-29 08:43:29 +01:00
rodzic f3582b95f5
commit e9066fe2a4
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -79,18 +79,18 @@ void DialogPositioner::positionDialog(QWidget *dialog)
// Position so fully on screen
QRect desktop = dialog->screen()->availableGeometry();
QSize size = dialog->size();
QRect geometry = dialog->frameGeometry();
QPoint pos = dialog->pos();
bool move = false;
if (pos.x() + size.width() > desktop.width())
if (pos.x() + geometry.width() > desktop.width())
{
pos.setX(desktop.width() - size.width());
pos.setX(desktop.width() - geometry.width());
move = true;
}
if (pos.y() + size.height() > desktop.height())
if (pos.y() + geometry.height() > desktop.height())
{
pos.setY(desktop.height() - size.height());
pos.setY(desktop.height() - geometry.height());
move = true;
}
if (move) {