Commit a841445f authored by Kåre Särs's avatar Kåre Särs
Browse files

Do not close the GitBlameTooltip if it has a selection.

Do not wrap diff lines
parent 4e6f7d9f
......@@ -135,6 +135,7 @@ public:
Private() : QTextBrowser(nullptr)
{
setWindowFlags(Qt::FramelessWindowHint | Qt::BypassGraphicsProxyWidget | Qt::ToolTip);
setWordWrapMode(QTextOption::NoWrap);
document()->setDocumentMargin(10);
setFrameStyle(QFrame::Box | QFrame::Raised);
connect(&m_hideTimer, &QTimer::timeout, this, &Private::hideTooltip);
......@@ -247,6 +248,7 @@ public:
}
close();
setText(QString());
m_inContextMenu = false;
}
void fixGeometry()
......@@ -284,7 +286,9 @@ protected:
void leaveEvent(QEvent *event) override
{
if (!m_hideTimer.isActive() && !m_inContextMenu) {
if (!m_hideTimer.isActive() && !m_inContextMenu &&
textCursor().selectionStart() == textCursor().selectionEnd()
) {
hideTooltip();
}
return QTextBrowser::leaveEvent(event);
......@@ -293,7 +297,9 @@ protected:
void mouseMoveEvent(QMouseEvent *event) override
{
auto pos = event->pos();
if (rect().contains(pos)) {
if (rect().contains(pos) || m_inContextMenu ||
textCursor().selectionStart() != textCursor().selectionEnd()
) {
return QTextBrowser::mouseMoveEvent(event);
}
hideTooltip();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment