┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRafael Fernández López <[email protected]>2007-07-14 04:01:58 +0000
committerRafael Fernández López <[email protected]>2007-07-14 04:01:58 +0000
commit1bc9506260a42691ded588db1f708fc11913774d (patch)
treef4a827488d16b18da442ee9ca4520f6a7f5670fb /src
parent6c64d1ca6b37c24b8e6f79f02923aeca9de2616d (diff)
If we have different heights on the same row, make it possible to update taller items correctly when the mouse is over the part that goes "out of the little one" line
svn path=/trunk/KDE/kdebase/apps/; revision=687625
Diffstat (limited to 'src')
-rw-r--r--src/kcategorizedview.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/kcategorizedview.cpp b/src/kcategorizedview.cpp
index 3255de9a4..cc83e2de9 100644
--- a/src/kcategorizedview.cpp
+++ b/src/kcategorizedview.cpp
@@ -98,6 +98,17 @@ const QModelIndexList &KCategorizedView::Private::intersectionSet(const QRect &r
intersectedIndexes.clear();
+ int itemHeight;
+
+ if (listView->gridSize().isEmpty())
+ {
+ itemHeight = biggestItemSize.height();
+ }
+ else
+ {
+ itemHeight = listView->gridSize().height();
+ }
+
// Lets find out where we should start
int top = proxyModel->rowCount() - 1;
int bottom = 0;
@@ -108,10 +119,13 @@ const QModelIndexList &KCategorizedView::Private::intersectionSet(const QRect &r
index = elementDictionary[proxyModel->index(middle, 0)];
indexVisualRect = visualRect(index);
+ // We need the whole height (not only the visualRect). This will help us to update
+ // all needed indexes correctly (ereslibre)
+ indexVisualRect.setHeight(indexVisualRect.height() + (itemHeight - indexVisualRect.height()));
if (qMax(indexVisualRect.topLeft().y(),
indexVisualRect.bottomRight().y()) < qMin(rect.topLeft().y(),
- rect.bottomRight().y()))
+ rect.bottomRight().y()))
{
bottom = middle + 1;
}