From kde-commits Thu Jul 31 20:48:38 2014 From: Jaroslaw Staniek Date: Thu, 31 Jul 2014 20:48:38 +0000 To: kde-commits Subject: [calligra] kexi/widget: Correct row selection/highlighting when clicking/hovering over record marker Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=140683972917315 Git commit 8ca7607e13dd6cd5c55efc32c7aece89dc8978da by Jaroslaw Staniek. Committed on 30/07/2014 at 15:31. Pushed by staniek into branch 'master'. 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/8ca7607e13dd6cd5c55efc32c7aece89dc8978da diff --git a/kexi/widget/tableview/kexitableview.cpp b/kexi/widget/tablevie= w/kexitableview.cpp index e2741e5..711531c 100644 --- a/kexi/widget/tableview/kexitableview.cpp +++ b/kexi/widget/tableview/kexitableview.cpp @@ -2320,7 +2320,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 6ee8369..5ed82e4 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);