Browse Source

Merge pull request #5222

ezavod (1):
      fix(chatform): mark message with triple click
reviewable/pr5226/r1
sudden6 7 years ago
parent
commit
2e211d4201
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 20
      src/chatlog/chatlog.cpp
  2. 1
      src/chatlog/chatlog.h

20
src/chatlog/chatlog.cpp

@ -197,8 +197,14 @@ void ChatLog::mousePressEvent(QMouseEvent* ev) @@ -197,8 +197,14 @@ void ChatLog::mousePressEvent(QMouseEvent* ev)
clearSelection();
}
// Counts only single clicks and first click of doule click
clickCount++;
if (lastClickButton == ev->button()) {
// Counts only single clicks and first click of doule click
clickCount++;
}
else {
clickCount = 1; // restarting counter
lastClickButton = ev->button();
}
lastClickPos = ev->pos();
// Triggers on odd click counts
@ -477,8 +483,14 @@ void ChatLog::mouseDoubleClickEvent(QMouseEvent* ev) @@ -477,8 +483,14 @@ void ChatLog::mouseDoubleClickEvent(QMouseEvent* ev)
emit selectionChanged();
}
// Counts the second click of double click
clickCount++;
if (lastClickButton == ev->button()) {
// Counts the second click of double click
clickCount++;
}
else {
clickCount = 1; // restarting counter
lastClickButton = ev->button();
}
lastClickPos = ev->pos();
// Triggers on even click counts

1
src/chatlog/chatlog.h

@ -154,6 +154,7 @@ private: @@ -154,6 +154,7 @@ private:
AutoScrollDirection selectionScrollDir = NoDirection;
int clickCount = 0;
QPoint lastClickPos;
Qt::MouseButton lastClickButton;
// worker vars
int workerLastIndex = 0;

Loading…
Cancel
Save