diff options
| author | Rafael Fernández López <[email protected]> | 2007-12-16 02:14:15 +0000 |
|---|---|---|
| committer | Rafael Fernández López <[email protected]> | 2007-12-16 02:14:15 +0000 |
| commit | f55fe7bce6cabcd92fbd195fa549248a8c899e7b (patch) | |
| tree | 56640b3e5886a1df115c900f26760627d39c82d1 /src | |
| parent | 8fea48eb445d893170a62619df8636c5b4c582b7 (diff) | |
The latest fix still had the same problem when dragging went out of the viewport and entered again. Non droppable places (e.g. files) were still drawn with MouseOver
flag. This completely fixes the problem for all cases, the problem was the hovered cached index being updated at indexAt() method used for general purposes. Now it is
updated on the MouseMove method, and this gives consistence.
CCMAIL: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=748970
Diffstat (limited to 'src')
| -rw-r--r-- | src/kcategorizedview.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/kcategorizedview.cpp b/src/kcategorizedview.cpp index d612f4b1c..42ee7b1ad 100644 --- a/src/kcategorizedview.cpp +++ b/src/kcategorizedview.cpp @@ -662,8 +662,6 @@ QModelIndex KCategorizedView::indexAt(const QPoint &point) const index = item[0]; } - d->hovered = index; - return index; } @@ -744,7 +742,10 @@ void KCategorizedView::paintEvent(QPaintEvent *event) option.state |= QStyle::State_Editing; } - if ((index == d->hovered) && !d->mouseButtonPressed && (this->state() != QAbstractItemView::DraggingState)) + // we are only interested to give the mouse over feedback when no + // dragging is happening (ereslibre) + if ((index == d->hovered) && !d->mouseButtonPressed && + (this->state() == QAbstractItemView::NoState)) option.state |= QStyle::State_MouseOver; else option.state &= ~QStyle::State_MouseOver; @@ -986,6 +987,17 @@ void KCategorizedView::mouseMoveEvent(QMouseEvent *event) return; } + QModelIndexList item = d->intersectionSet(QRect(event->pos(), event->pos())); + + if (item.count() == 1) + { + d->hovered = item[0]; + } + else + { + d->hovered = QModelIndex(); + } + const QString previousHoveredCategory = d->hoveredCategory; d->mousePosition = event->pos(); |
