| 681 | } |
| 682 | |
| 683 | void DiffTextWindow::mousePressEvent(QMouseEvent* e) |
| 684 | { |
| 685 | qCInfo(kdiffDiffTextWindow) << "mousePressEvent triggered"; |
| 686 | if(e->button() == Qt::LeftButton) |
| 687 | { |
| 688 | LineRef line; |
| 689 | qint32 pos; |
| 690 | convertToLinePos(e->pos().x(), e->pos().y(), line, pos); |
| 691 | qCInfo(kdiffDiffTextWindow) << "Left Button detected,"; |
| 692 | qCDebug(kdiffDiffTextWindow) << "line = " << line << ", pos = " << pos; |
| 693 | |
| 694 | //TODO: Fix after line number area is converted to a QWidget. |
| 695 | qint32 fontWidth = fontMetrics().horizontalAdvance('0'); |
| 696 | qint32 xOffset = d->leftInfoWidth() * fontWidth; |
| 697 | |
| 698 | if((!gOptions->m_bRightToLeftLanguage && e->pos().x() < xOffset) || (gOptions->m_bRightToLeftLanguage && e->pos().x() > width() - xOffset)) |
| 699 | { |
| 700 | Q_EMIT setFastSelectorLine(convertLineToDiff3LineIdx(line)); |
| 701 | d->m_selection.reset(); // Disable current d->m_selection |
| 702 | } |
| 703 | else |
| 704 | { // Selection |
| 705 | resetSelection(); |
| 706 | d->m_selection.start(line, pos); |
| 707 | d->m_selection.end(line, pos); |
| 708 | d->m_bSelectionInProgress = true; |
| 709 | d->m_lastKnownMousePos = e->pos(); |
| 710 | |
| 711 | showStatusLine(line); |
| 712 | } |
| 713 | } |
| 714 | } |
| 715 | |
| 716 | void DiffTextWindow::mouseDoubleClickEvent(QMouseEvent* e) |
| 717 | { |
nothing calls this directly
no test coverage detected