diff --git a/tools/chatgui/src/chatview.cpp b/tools/chatgui/src/chatview.cpp index 7b5b256d..ac0bd7e5 100644 --- a/tools/chatgui/src/chatview.cpp +++ b/tools/chatgui/src/chatview.cpp @@ -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; } } diff --git a/tools/chatgui/src/chatview.h b/tools/chatgui/src/chatview.h index e0c75c12..7cfbd951 100644 --- a/tools/chatgui/src/chatview.h +++ b/tools/chatgui/src/chatview.h @@ -33,11 +33,11 @@ public: bool isRowSelected(const QModelIndex &idx) const; void setTextSelChars(int start, int end) { m_textSel.startChar = start; m_textSel.endChar = end; } - void setInviteHitTest(std::function fn) { m_inviteHitTest = std::move(fn); } + void setLinkHitTest(std::function fn) { m_linkHitTest = std::move(fn); } signals: void animationTriggered(); - void inviteLinkActivated(const QString& link); + void linkActivated(const QString& link); protected: bool viewportEvent(QEvent *event) override; @@ -62,6 +62,6 @@ private: QPersistentModelIndex m_pressIndex; QPoint m_pressPos; bool m_selecting = false; - std::function m_inviteHitTest; + std::function m_linkHitTest; QPushButton *m_scrollDownBtn = nullptr; };