mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(chatform): mark message with triple click
Fixes #5211. Only trigger on triple clicks that are caused by the same mouse button clicked successively.
This commit is contained in:
parent
2a8ab03e46
commit
2cdff7e9ed
|
@ -197,8 +197,14 @@ void ChatLog::mousePressEvent(QMouseEvent* ev)
|
||||||
clearSelection();
|
clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lastClickButton == ev->button()) {
|
||||||
// Counts only single clicks and first click of doule click
|
// Counts only single clicks and first click of doule click
|
||||||
clickCount++;
|
clickCount++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
clickCount = 1; // restarting counter
|
||||||
|
lastClickButton = ev->button();
|
||||||
|
}
|
||||||
lastClickPos = ev->pos();
|
lastClickPos = ev->pos();
|
||||||
|
|
||||||
// Triggers on odd click counts
|
// Triggers on odd click counts
|
||||||
|
@ -477,8 +483,14 @@ void ChatLog::mouseDoubleClickEvent(QMouseEvent* ev)
|
||||||
emit selectionChanged();
|
emit selectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lastClickButton == ev->button()) {
|
||||||
// Counts the second click of double click
|
// Counts the second click of double click
|
||||||
clickCount++;
|
clickCount++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
clickCount = 1; // restarting counter
|
||||||
|
lastClickButton = ev->button();
|
||||||
|
}
|
||||||
lastClickPos = ev->pos();
|
lastClickPos = ev->pos();
|
||||||
|
|
||||||
// Triggers on even click counts
|
// Triggers on even click counts
|
||||||
|
|
|
@ -154,6 +154,7 @@ private:
|
||||||
AutoScrollDirection selectionScrollDir = NoDirection;
|
AutoScrollDirection selectionScrollDir = NoDirection;
|
||||||
int clickCount = 0;
|
int clickCount = 0;
|
||||||
QPoint lastClickPos;
|
QPoint lastClickPos;
|
||||||
|
Qt::MouseButton lastClickButton;
|
||||||
|
|
||||||
// worker vars
|
// worker vars
|
||||||
int workerLastIndex = 0;
|
int workerLastIndex = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user