mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixed emotes selecting the whole line on double-click.
This commit is contained in:
parent
c8326d73e7
commit
335b889efe
1 changed files with 7 additions and 2 deletions
|
@ -1021,7 +1021,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
|
|||
const MessageLayoutElement *hoverLayoutElement =
|
||||
layout->getElementAt(relativePos);
|
||||
|
||||
// Triple-click next to message selects whole message
|
||||
// Triple-clicking a message selects the whole message
|
||||
if (this->clickTimer_->isActive() && this->selecting_) {
|
||||
this->selectWholeMessage(layout.get(), messageIndex);
|
||||
}
|
||||
|
@ -1200,7 +1200,12 @@ void ChannelView::mouseDoubleClickEvent(QMouseEvent *event)
|
|||
hoverLayoutElement->getMouseOverIndex(relativePos);
|
||||
const int wordStart =
|
||||
layout->getSelectionIndex(relativePos) - mouseInWordIndex;
|
||||
const int wordEnd = wordStart + hoverLayoutElement->getText().length();
|
||||
const int selectionLength =
|
||||
hoverLayoutElement->getSelectionIndexCount();
|
||||
const int length = hoverLayoutElement->hasTrailingSpace()
|
||||
? selectionLength - 1
|
||||
: selectionLength;
|
||||
const int wordEnd = wordStart + length;
|
||||
|
||||
this->clickTimer_->start();
|
||||
|
||||
|
|
Loading…
Reference in a new issue