aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c/episodelistview.c17
-rw-r--r--c/resource.rc2
2 files changed, 13 insertions, 6 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);
diff --git a/c/resource.rc b/c/resource.rc
index 0541cbd..e970565 100644
--- a/c/resource.rc
+++ b/c/resource.rc
@@ -13,7 +13,7 @@ BEGIN
END
POPUP "&View"
BEGIN
- MENUITEM "&Watched Episodes", ID_VIEW_WATCHED, CHECKED
+ MENUITEM "&Watched", ID_VIEW_WATCHED, CHECKED
END
POPUP "&Help"
BEGIN