aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@theqtcompany.com>2015-04-28 07:11:54 +0200
committerDavid Schulz <david.schulz@theqtcompany.com>2015-04-28 08:44:55 +0000
commite75620c60d4e55b167dce16016e4d8d63a792c49 (patch)
treed227030d5f590893e3c0deef3a8e1d6bac2e4807
parente4e998362214aecab257dc3a56e80e6564076ee6 (diff)
Editor: Limit size of generic proposal widget.
Task-number: QTCREATORBUG-14331 Change-Id: I3a120c82628e3cd43f9abc3c97021a3674300fbc Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r--src/plugins/texteditor/codeassist/genericproposalwidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
index 6996048bff..0c974729cc 100644
--- a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
+++ b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
@@ -531,10 +531,10 @@ void GenericProposalWidget::updatePositionAndSize()
QPoint pos = d->m_displayRect.bottomLeft();
pos.rx() -= 16 + fw; // Space for the icons
if (pos.y() + height > screen.bottom())
- pos.setY(d->m_displayRect.top() - height);
+ pos.setY(qMax(0, d->m_displayRect.top() - height));
if (pos.x() + width > screen.right())
- pos.setX(screen.right() - width);
- setGeometry(pos.x(), pos.y(), width, height);
+ pos.setX(qMax(0, screen.right() - width));
+ setGeometry(pos.x(), pos.y(), qMin(width, screen.width()), qMin(height, screen.height()));
}
void GenericProposalWidget::turnOffAutoWidth()