[GB.QT4]
* BUG: Modal dialogs now should be centered in the screen of their parent window, not always in the main screen anymore. [GB.QT5] * BUG: Modal dialogs now should be centered in the screen of their parent window, not always in the main screen anymore. git-svn-id: svn://localhost/gambas/trunk@7279 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
c284885cb9
commit
29306e8476
1 changed files with 7 additions and 1 deletions
|
@ -2440,13 +2440,19 @@ void MyMainWindow::center(bool force = false)
|
|||
CWINDOW *_object = (CWINDOW *)CWidget::get(this);
|
||||
QPoint p;
|
||||
QRect r;
|
||||
int screen;
|
||||
|
||||
if (!force && !THIS->mustCenter)
|
||||
return;
|
||||
|
||||
if (!force && parentWidget())
|
||||
screen = QApplication::desktop()->screenNumber(parentWidget());
|
||||
else
|
||||
screen = QApplication::desktop()->screenNumber(this);
|
||||
|
||||
THIS->mustCenter = false;
|
||||
|
||||
r = QApplication::desktop()->availableGeometry(QApplication::desktop()->screenNumber(this));
|
||||
r = QApplication::desktop()->availableGeometry(screen);
|
||||
|
||||
CWIDGET_move(THIS, r.x() + (r.width() - width()) / 2, r.y() + (r.height() - height()) / 2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue