Skip to content
Snippets Groups Projects
Commit 774e5365 authored by Ariya Hidayat's avatar Ariya Hidayat
Browse files

Show pointing hand cursor when hovering a change number (e.g. git SHA1).

RevBy: Friedemann Kleint
parent 87f76a0d
No related branches found
No related tags found
No related merge requests found
...@@ -214,6 +214,9 @@ void VCSBaseEditor::contextMenuEvent(QContextMenuEvent *e) ...@@ -214,6 +214,9 @@ void VCSBaseEditor::contextMenuEvent(QContextMenuEvent *e)
void VCSBaseEditor::mouseMoveEvent(QMouseEvent *e) void VCSBaseEditor::mouseMoveEvent(QMouseEvent *e)
{ {
bool overrideCursor = false;
Qt::CursorShape cursorShape;
if (m_d->m_parameters->type == LogOutput || m_d->m_parameters->type == AnnotateOutput) { if (m_d->m_parameters->type == LogOutput || m_d->m_parameters->type == AnnotateOutput) {
// Link emulation behaviour for 'click on change-interaction' // Link emulation behaviour for 'click on change-interaction'
QTextCursor cursor = cursorForPosition(e->pos()); QTextCursor cursor = cursorForPosition(e->pos());
...@@ -226,13 +229,18 @@ void VCSBaseEditor::mouseMoveEvent(QMouseEvent *e) ...@@ -226,13 +229,18 @@ void VCSBaseEditor::mouseMoveEvent(QMouseEvent *e)
change = changeUnderCursor(cursor); change = changeUnderCursor(cursor);
sel.format.setProperty(QTextFormat::UserProperty, change); sel.format.setProperty(QTextFormat::UserProperty, change);
setExtraSelections(OtherSelection, QList<QTextEdit::ExtraSelection>() << sel); setExtraSelections(OtherSelection, QList<QTextEdit::ExtraSelection>() << sel);
viewport()->setCursor(Qt::PointingHandCursor); overrideCursor = true;
cursorShape = Qt::PointingHandCursor;
} }
} else { } else {
setExtraSelections(OtherSelection, QList<QTextEdit::ExtraSelection>()); setExtraSelections(OtherSelection, QList<QTextEdit::ExtraSelection>());
viewport()->setCursor(Qt::IBeamCursor); overrideCursor = true;
cursorShape = Qt::IBeamCursor;
} }
TextEditor::BaseTextEditor::mouseMoveEvent(e); TextEditor::BaseTextEditor::mouseMoveEvent(e);
if (overrideCursor)
viewport()->setCursor(cursorShape);
} }
void VCSBaseEditor::mouseReleaseEvent(QMouseEvent *e) void VCSBaseEditor::mouseReleaseEvent(QMouseEvent *e)
......
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