Skip to content
Snippets Groups Projects
Commit 1a772c1b authored by mae's avatar mae
Browse files

some minor popup tuning

parent 0c7312e0
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@
#include <QtGui/QLabel>
#include <QtGui/QStylePainter>
#include <QtGui/QToolTip>
#include <QtCore/QTimer>
#include <limits.h>
......@@ -300,30 +301,24 @@ void CompletionListView::maybeShowInfoTip()
QRect r = rectForIndex(current);
m_infoFrame->move(
(parentWidget()->mapToGlobal(
parentWidget()->rect().topRight() + QPoint(2, 0))).x(),
parentWidget()->rect().topRight() + QPoint(0, 0))).x(),
mapToGlobal(r.topRight()).y() - verticalOffset()
);
m_infoFrame->setText(infoTip);
m_infoFrame->adjustSize();
m_infoFrame->show();
m_infoFrame->raise();
}
void CompletionListView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
QListView::currentChanged(current, previous);
if (isVisible())
maybeShowInfoTip();
QTimer::singleShot(0, this, SLOT(maybeShowInfoTip()));
}
bool CompletionListView::event(QEvent *e)
{
if (e->type() == QEvent::Show) {
bool b = QListView::event(e);
maybeShowInfoTip();
return b;
}
if (m_blockFocusOut)
return QListView::event(e);
......
......@@ -101,7 +101,9 @@ private:
void setCompletionItems(const QList<TextEditor::CompletionItem> &completionitems);
void keyboardSearch(const QString &search);
void closeList(const QModelIndex &index);
private slots:
void maybeShowInfoTip();
private:
bool m_blockFocusOut;
bool m_quickFix;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment