mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-28 21:12:26 -04:00
Use frame geo rather than widget size, so dialogs aren't positioned off screen on Windows.
This commit is contained in:
parent
f3582b95f5
commit
e9066fe2a4
@ -79,18 +79,18 @@ void DialogPositioner::positionDialog(QWidget *dialog)
|
|||||||
|
|
||||||
// Position so fully on screen
|
// Position so fully on screen
|
||||||
QRect desktop = dialog->screen()->availableGeometry();
|
QRect desktop = dialog->screen()->availableGeometry();
|
||||||
QSize size = dialog->size();
|
QRect geometry = dialog->frameGeometry();
|
||||||
QPoint pos = dialog->pos();
|
QPoint pos = dialog->pos();
|
||||||
|
|
||||||
bool move = false;
|
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;
|
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;
|
move = true;
|
||||||
}
|
}
|
||||||
if (move) {
|
if (move) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user