File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,23 @@ Panel {
42
42
property int lastIndex: - 1
43
43
44
44
onContentYChanged: {
45
- // the index for section/network items is -1 => retain the previous index
46
45
var first = indexAt (0 , contentY + Theme .itemSizeExtraSmall )
46
+ if (first === - 1 ) {
47
+ // the first item is a section item (a network delegate)
48
+ var firstItem = contentItem .childAt (0 , contentY + Theme .itemSizeExtraSmall )
49
+ if (firstItem && firstItem .buffer )
50
+ first = BufferModel .indexOf (firstItem .buffer )
51
+ }
47
52
if (first !== - 1 )
48
53
firstIndex = first
54
+
49
55
var last = indexAt (0 , contentY + height)
56
+ if (last === - 1 ) {
57
+ // the last item is a section item (a network delegate)
58
+ var lastItem = contentItem .childAt (0 , contentY + height)
59
+ if (lastItem && lastItem .buffer )
60
+ last = BufferModel .indexOf (lastItem .buffer )
61
+ }
50
62
if (last !== - 1 )
51
63
lastIndex = last
52
64
}
You can’t perform that action at this time.
0 commit comments