forked from qt-creator/qt-creator
Utils: Ensure that VariableChooser window title bar stays on screen
Prevent negative y-coordinates when centering the VariableChooser over the launching toolbutton. Fixes: QTCREATORBUG-27054 Change-Id: I4212c7120470f8c2014fbe27205de8430cd13a6f Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -544,7 +544,7 @@ void VariableChooserPrivate::updatePositionAndShow(bool)
|
||||
{
|
||||
if (QWidget *w = q->parentWidget()) {
|
||||
QPoint parentCenter = w->mapToGlobal(w->geometry().center());
|
||||
q->move(parentCenter.x() - q->width()/2, parentCenter.y() - q->height()/2);
|
||||
q->move(parentCenter.x() - q->width()/2, qMax(parentCenter.y() - q->height()/2, 0));
|
||||
}
|
||||
q->show();
|
||||
q->raise();
|
||||
|
||||
Reference in New Issue
Block a user