[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/calligra/2.8] kexi/widget: Correct row selection/highlighting when clicking/hovering over 
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2014-07-31 20:54:31
Message-ID: E1XCxMt-0003Fi-Ro () scm ! kde ! org
[Download RAW message or body]

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 (vertically) \
when it's partially visible.

This fix will also addresses issue reported at \
https://forum.kde.org/viewtopic.php?f=221&t=122102 "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/tableview/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 != -1) {
         record = qMin(rows() - 1 + (isInsertingEnabled() ? 1 : 0), record);
         record = qMax(0, record);
-        ensureCellVisible(record, -1);
     }
     const int previouslyHighlightedRecord = d->highlightedRecord;
     if (previouslyHighlightedRecord == record) {
diff --git a/kexi/widget/utils/kexirecordmarker.cpp \
b/kexi/widget/utils/kexirecordmarker.cpp index ce9e490..f1910f6 100644
--- a/kexi/widget/utils/kexirecordmarker.cpp
+++ b/kexi/widget/utils/kexirecordmarker.cpp
@@ -298,8 +298,8 @@ QBrush KexiRecordMarker::selectionBackgroundBrush() const
 
 void KexiRecordMarker::mouseMoveEvent(QMouseEvent *e)
 {
-    const int y = e->y();
-//    kDebug() << "y:" << y << "d->rowHeight:" << d->rowHeight;
+    const int y = 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 = y / d->rowHeight;
     if ((int)row < rows()) {
@@ -315,7 +315,7 @@ void KexiRecordMarker::mouseMoveEvent(QMouseEvent *e)
 
 void KexiRecordMarker::mousePressEvent(QMouseEvent *e)
 {
-    const int y = e->y();
+    const int y = e->y() + d->offset;
     const uint row = y / d->rowHeight;
     if ((int)row < rows()) {
         emit rowPressed(row);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic