fix #LINQT-1433 highlight and position view at current index meeting list

This commit is contained in:
Gaelle Braud 2024-11-22 14:21:32 +01:00
parent 0b193de0bb
commit 733702b781
3 changed files with 3 additions and 5 deletions

View file

@ -88,9 +88,9 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
// int index2;
// get(mLastConfInfoInserted.get(), &index2);
if (index != -1) setCurrentDateIndex(index);
else setCurrentDateIndex(mHaveCurrentDate ? currentDateIndex + 1 : currentDateIndex);
else setCurrentDateIndex(mHaveCurrentDate ? currentDateIndex : currentDateIndex + 1);
mLastConfInfoInserted = nullptr;
} else setCurrentDateIndex(mHaveCurrentDate ? currentDateIndex + 1 : currentDateIndex);
} else setCurrentDateIndex(mHaveCurrentDate ? currentDateIndex : currentDateIndex + 1);
delete items;
});
});

View file

@ -28,6 +28,7 @@ ListView {
}
onCurrentIndexChanged: {
selectedConference = model.getAt(currentIndex) || null
positionViewAtIndex(currentIndex, ListView.Center)
}
onVisibleChanged: if( visible) {
mainItem.positionViewAtIndex(currentIndex, ListView.Center)// First approximative move

View file

@ -188,9 +188,6 @@ AbstractMainPage {
Layout.fillWidth: true
Layout.fillHeight: true
preferredHighlightBegin: height/2 - 10
preferredHighlightEnd: height/2 + 10
highlightRangeMode: ListView.ApplyRange
onCountChanged: mainItem.meetingListCount = count
searchBarText: searchBar.text
Keys.onPressed: (event) => {