|
|
|
|
@ -154,7 +154,7 @@ void ChatView::mouseMoveEvent(QMouseEvent *event) {
|
|
|
|
|
} |
|
|
|
|
if (!m_selecting) { |
|
|
|
|
QModelIndex idx = indexAt(viewport()->mapFrom(this, event->pos())); |
|
|
|
|
const bool link = m_inviteHitTest && !m_inviteHitTest(idx, event->pos()).isEmpty(); |
|
|
|
|
const bool link = m_linkHitTest && !m_linkHitTest(idx, event->pos()).isEmpty(); |
|
|
|
|
viewport()->setCursor(link ? Qt::PointingHandCursor : Qt::ArrowCursor); |
|
|
|
|
if (idx != QModelIndex(m_lastHovered)) { |
|
|
|
|
m_lastHovered = idx; |
|
|
|
|
@ -185,11 +185,11 @@ void ChatView::mouseReleaseEvent(QMouseEvent *event) {
|
|
|
|
|
const QModelIndex pressed(m_pressIndex); |
|
|
|
|
if (event->button() == Qt::LeftButton && !m_selecting && pressed.isValid() && |
|
|
|
|
(event->pos() - m_pressPos).manhattanLength() < 5 && indexAt(event->pos()) == pressed) { |
|
|
|
|
const QString link = m_inviteHitTest ? m_inviteHitTest(pressed, event->pos()) : QString(); |
|
|
|
|
const QString link = m_linkHitTest ? m_linkHitTest(pressed, event->pos()) : QString(); |
|
|
|
|
if (!link.isEmpty()) { |
|
|
|
|
m_pressIndex = QPersistentModelIndex(); |
|
|
|
|
GUI_INFO("invite link: activated row=%d bytes=%d", pressed.row(), link.size()); |
|
|
|
|
emit inviteLinkActivated(link); |
|
|
|
|
GUI_INFO("message link: activated row=%d bytes=%d", pressed.row(), link.size()); |
|
|
|
|
emit linkActivated(link); |
|
|
|
|
event->accept(); return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|