[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra] kexi/widget: Correct row selection/highlighting when clicking/hovering over record marker
From: Jaroslaw Staniek <staniek () kde ! org>
Date: 2014-07-31 20:48:38
Message-ID: E1XCxHC-0002UD-8r () scm ! kde ! org
[Download RAW message or body]
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 (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/8ca7607e13dd6cd5c55efc32c7aece89dc8978da
diff --git a/kexi/widget/tableview/kexitableview.cpp \
b/kexi/widget/tableview/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 != -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 6ee8369..5ed82e4 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