1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

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

This commit is contained in:
srcejon 2023-09-29 08:43:29 +01:00
parent f3582b95f5
commit e9066fe2a4

View File

@ -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) {