@@ -30,9 +30,7 @@ Item {
3030 // Sets the position of the background highlight
3131 function updateHighlight(session) {
3232 sessionsList.currentIndex = getIndexOfSession(session);
33−
34− var newY = sessionsList.currentItem.y + sessionsList.headerItem.height
35− sessionsList.backgroundHighlight.y = newY;
33+ sessionsList.currentItem.initialSession = session;
3634 }
3735
3836 function getIndexOfSession(session) {
@@ -104,8 +102,6 @@ Item {
104102 UbuntuListView {
105103 id: sessionsList
106104
107− readonly property alias backgroundHighlight: backgroundHighlight
108−
109105 anchors {
110106 top: parent.top
111107 left: parent.left
@@ -146,22 +142,12 @@ Item {
146142 highlightFollowsCurrentItem: false
147143 highlight: QtObject {}
148144
149− Rectangle {
150− id: backgroundHighlight
151−
152− height: sessionsList.currentItem.height
153− width: sessionsList.currentItem.width
154− color: theme.palette.normal.selection
155−
156− visible: y > sessionsList.headerItem.y
157− + sessionsList.headerItem.height
158− - sessionsList.anchors.margins
159− }
160−
161145 delegate: ListItem {
162146 id: delegate
163147 objectName: "sessionDelegate" + index
164148
149+ property string initialSession: ""
150+
165151 divider.visible: false
166152 visible: y > sessionsList.headerItem.y
167153 + sessionsList.headerItem.height
@@ -176,6 +162,16 @@ Item {
176162 }
177163 }
178164
165+ Rectangle {
166+ id: backgroundHighlight
167+
168+ height: sessionsList.currentItem.height
169+ width: sessionsList.currentItem.width
170+ color: theme.palette.normal.selection
171+
172+ visible: initialSession === key && key.length
173+ }
174+
179175 Rectangle {
180176 height: parent.height
181177 width: parent.width