diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-07-27 10:08:58 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-28 05:04:24 +0200 |
commit | 7062c0e2d273ed32a7fd33d5320e811ef72e6682 (patch) | |
tree | 94f48c0fcc4062029ac0b78cd31b97ee0791ef6f /src | |
parent | 0e008e9a8fc32d84c03e88a4a41ec8801b274979 (diff) |
View highlight flickers with highlightRangeMode: ApplyRange
The view position was alternating between the start and end
of the highlight range if the range < delegate size. Now
favor the range start in this case, as per StrictlyEnforceRange.
Change-Id: Icb895f972ccb9598ecf7238259093584c43ae291
Fixes: QTBUG-18067
Reviewed-on: http://codereview.qt.nokia.com/2226
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/items/qsgitemview.cpp | 7 | ||||
-rw-r--r-- | src/qtquick1/graphicsitems/qdeclarativegridview.cpp | 7 | ||||
-rw-r--r-- | src/qtquick1/graphicsitems/qdeclarativelistview.cpp | 7 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/declarative/items/qsgitemview.cpp b/src/declarative/items/qsgitemview.cpp index a9550e82b7..0198d5816d 100644 --- a/src/declarative/items/qsgitemview.cpp +++ b/src/declarative/items/qsgitemview.cpp @@ -753,11 +753,10 @@ void QSGItemView::trackedPositionChanged() if (pos < d->startPosition()) pos = d->startPosition(); } else { - if (trackedPos < viewPos + highlightStart) { - pos = trackedPos - highlightStart; - } else if (trackedPos > viewPos + highlightEnd - trackedSize) { + if (trackedPos > pos + highlightEnd - trackedSize) pos = trackedPos - highlightEnd + trackedSize; - } + if (trackedPos < pos + highlightStart) + pos = trackedPos - highlightStart; } } } else { diff --git a/src/qtquick1/graphicsitems/qdeclarativegridview.cpp b/src/qtquick1/graphicsitems/qdeclarativegridview.cpp index ff54b13b21..f81256c2ba 100644 --- a/src/qtquick1/graphicsitems/qdeclarativegridview.cpp +++ b/src/qtquick1/graphicsitems/qdeclarativegridview.cpp @@ -2714,11 +2714,10 @@ void QDeclarative1GridView::trackedPositionChanged() if (pos < d->startPosition()) pos = d->startPosition(); } else { - if (trackedPos < viewPos + highlightStart) { - pos = trackedPos - highlightStart; - } else if (trackedPos > viewPos + highlightEnd - d->rowSize()) { + if (trackedPos > pos + highlightEnd - d->rowSize()) pos = trackedPos - highlightEnd + d->rowSize(); - } + if (trackedPos < pos + highlightStart) + pos = trackedPos - highlightStart; } } } else { diff --git a/src/qtquick1/graphicsitems/qdeclarativelistview.cpp b/src/qtquick1/graphicsitems/qdeclarativelistview.cpp index 1e6a4a039c..8fafdbe6e3 100644 --- a/src/qtquick1/graphicsitems/qdeclarativelistview.cpp +++ b/src/qtquick1/graphicsitems/qdeclarativelistview.cpp @@ -3162,11 +3162,10 @@ void QDeclarative1ListView::trackedPositionChanged() if (pos < d->startPosition()) pos = d->startPosition(); } else { - if (trackedPos < viewPos + highlightStart) { - pos = trackedPos - highlightStart; - } else if (trackedPos > viewPos + highlightEnd - trackedSize) { + if (trackedPos > pos + highlightEnd - trackedSize) pos = trackedPos - highlightEnd + trackedSize; - } + if (trackedPos < pos + highlightStart) + pos = trackedPos - highlightStart; } } } else { |