1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix selection

This commit is contained in:
krepa098 2015-01-02 11:25:07 +01:00
parent eecd886745
commit 4997788b13

View File

@ -291,39 +291,39 @@ void ChatLog::mouseMoveEvent(QMouseEvent* ev)
scene->mouseGrabberItem()->ungrabMouse(); scene->mouseGrabberItem()->ungrabMouse();
} }
} }
}
if(selectionMode != None && ev->pos() != lastPos) if(selectionMode != None && ev->pos() != lastPos)
{
lastPos = ev->pos();
ChatLineContent* content = getContentFromPos(scenePos);
if(content)
{ {
int row = content->getRow(); lastPos = ev->pos();
int col = content->getColumn();
if(row >= selClickedRow) ChatLineContent* content = getContentFromPos(scenePos);
selLastRow = row;
if(row <= selClickedRow) if(content)
selFirstRow = row;
if(row == selClickedRow && col == selClickedCol)
{ {
selectionMode = Precise; int row = content->getRow();
int col = content->getColumn();
content->selectionMouseMove(scenePos); if(row >= selClickedRow)
selGraphItem->hide(); selLastRow = row;
}
else
{
selectionMode = Multi;
lines[selClickedRow]->selectionCleared(); if(row <= selClickedRow)
selFirstRow = row;
updateMultiSelectionRect(); if(row == selClickedRow && col == selClickedCol)
{
selectionMode = Precise;
content->selectionMouseMove(scenePos);
selGraphItem->hide();
}
else
{
selectionMode = Multi;
lines[selClickedRow]->selectionCleared();
updateMultiSelectionRect();
}
} }
} }
} }