From kde-commits Thu Jul 31 20:54:31 2014 From: Jaroslaw Staniek Date: Thu, 31 Jul 2014 20:54:31 +0000 To: kde-commits Subject: [calligra/calligra/2.8] kexi/widget: Correct row selection/highlighting when clicking/hovering over Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=140684008017522 Git commit b587d023acd3a6a9192e7ebea1ff8b191cdfdada by Jaroslaw Staniek. Committed on 30/07/2014 at 15:31. Pushed by staniek into branch 'calligra/2.8'. Correct row selection/highlighting when clicking/hovering over record marker (in table view) Moreover, highlighting a row should not force it to be entirely visible (ve= rtically) when it's partially visible. This fix will also addresses issue reported at https://forum.kde.org/viewto= pic.php?f=3D221&t=3D122102 "Any time the cursor crosses the border between = the Project Navigator and the Table Data (i.e. over the record marker), the= table abruptly jumps to the beginning." BUG:337914 FIXED-IN:2.8.6 M +0 -1 kexi/widget/tableview/kexitableview.cpp M +3 -3 kexi/widget/utils/kexirecordmarker.cpp http://commits.kde.org/calligra/b587d023acd3a6a9192e7ebea1ff8b191cdfdada diff --git a/kexi/widget/tableview/kexitableview.cpp b/kexi/widget/tablevie= w/kexitableview.cpp index 872b8f4..69e7c22 100644 --- a/kexi/widget/tableview/kexitableview.cpp +++ b/kexi/widget/tableview/kexitableview.cpp @@ -2657,7 +2657,6 @@ void KexiTableView::setHighlightedRecord(int record) if (record !=3D -1) { record =3D qMin(rows() - 1 + (isInsertingEnabled() ? 1 : 0), recor= d); record =3D qMax(0, record); - ensureCellVisible(record, -1); } const int previouslyHighlightedRecord =3D d->highlightedRecord; if (previouslyHighlightedRecord =3D=3D record) { diff --git a/kexi/widget/utils/kexirecordmarker.cpp b/kexi/widget/utils/kex= irecordmarker.cpp index ce9e490..f1910f6 100644 --- a/kexi/widget/utils/kexirecordmarker.cpp +++ b/kexi/widget/utils/kexirecordmarker.cpp @@ -298,8 +298,8 @@ QBrush KexiRecordMarker::selectionBackgroundBrush() con= st = void KexiRecordMarker::mouseMoveEvent(QMouseEvent *e) { - const int y =3D e->y(); -// kDebug() << "y:" << y << "d->rowHeight:" << d->rowHeight; + const int y =3D e->y() + d->offset; +// kDebug() << "y:" << e->y() << "d->rowHeight:" << d->rowHeight << "d-= >offset:" << d->offset; // kDebug() << "y / d->rowHeight:" << (y / d->rowHeight); const uint row =3D y / d->rowHeight; if ((int)row < rows()) { @@ -315,7 +315,7 @@ void KexiRecordMarker::mouseMoveEvent(QMouseEvent *e) = void KexiRecordMarker::mousePressEvent(QMouseEvent *e) { - const int y =3D e->y(); + const int y =3D e->y() + d->offset; const uint row =3D y / d->rowHeight; if ((int)row < rows()) { emit rowPressed(row);