mirror of
https://github.com/KDE/kasts.git
synced 2025-01-14 17:45:47 +01:00
Scroll to item that's opened from GlobalSearchPopup
This commit is contained in:
parent
25a22d7bdc
commit
757b88a84d
@ -43,17 +43,16 @@ Addons.SearchPopupField {
|
|||||||
pushPage("EpisodeListPage");
|
pushPage("EpisodeListPage");
|
||||||
pageStack.push("qrc:/EntryPage.qml", {"entry": entry});
|
pageStack.push("qrc:/EntryPage.qml", {"entry": entry});
|
||||||
|
|
||||||
/* let's not select the current item for now, since it can take a long
|
// Find the index of the entry on the EpisodeListPage and scroll to it
|
||||||
* time and will not automatically scroll to that item either
|
|
||||||
var episodeModel = pageStack.get(0).episodeList.model
|
var episodeModel = pageStack.get(0).episodeList.model
|
||||||
for (var i = 0; i < episodeModel.rowCount(); i++) {
|
for (var i = 0; i < episodeModel.rowCount(); i++) {
|
||||||
var index = episodeModel.index(i, 0);
|
var index = episodeModel.index(i, 0);
|
||||||
if (entry == episodeModel.data(index, AbstractEpisodeModel.EntryRole)) {
|
if (entry.id == episodeModel.data(index, AbstractEpisodeModel.IdRole)) {
|
||||||
pageStack.get(0).episodeList.currentIndex = i;
|
pageStack.get(0).episodeList.currentIndex = i;
|
||||||
pageStack.get(0).episodeList.selectionModel.setCurrentIndex(index, ItemSelectionModel.ClearAndSelect | ItemSelectionModel.Rows);
|
pageStack.get(0).episodeList.selectionModel.setCurrentIndex(index, ItemSelectionModel.ClearAndSelect | ItemSelectionModel.Rows);
|
||||||
|
pageStack.get(0).episodeList.positionViewAtIndex(i, ListView.Center);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
Loading…
Reference in New Issue
Block a user