diff options
Diffstat (limited to 'c/episodelistview.c')
-rw-r--r-- | c/episodelistview.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/c/episodelistview.c b/c/episodelistview.c index 925ce23..985a8ca 100644 --- a/c/episodelistview.c +++ b/c/episodelistview.c @@ -166,7 +166,7 @@ s: ListView_SetItemState(HElv, -1, LVIF_STATE, LVIS_SELECTED); void ElvUpdate() { - int i, iEpisode, iEpisodes, iItem, iTopNew; + int i, iEpisode, iEpisodes, iItem, iItemFound; LVITEM lviEpisode, lviTop; LVFINDINFO lvfiTopNew; term_t t; @@ -219,13 +219,20 @@ ElvUpdate() lvfiTopNew.flags = LVFI_PARAM; do lvfiTopNew.lParam = lviTop.lParam+i; - while ((iTopNew = ListView_FindItem(HElv, -1, &lvfiTopNew)) == -1 && i++ < 100); - if (iTopNew != -1) - ElvSetTop(iTopNew); + while ((iItemFound = ListView_FindItem(HElv, -1, &lvfiTopNew)) == -1 + && i++ < 100); + if (iItemFound != -1) + ElvSetTop(iItemFound); /* Reset selection. */ + i = 0; + lvfiTopNew.flags = LVFI_PARAM; + do + lvfiTopNew.lParam = LpLviElvSelection->lParam+i; + while ((iItemFound = ListView_FindItem(HElv, -1, &lvfiTopNew)) == -1 + && i++ < 100); if (LpLviElvSelection) - ListView_SetItemState(HElv, LpLviElvSelection->iItem, + ListView_SetItemState(HElv, iItemFound, LVIS_SELECTED, LVIS_SELECTED); SendMessage(HElv, WM_SETREDRAW, TRUE, 0); |