From c214b8f1f04467aec61611b91913ee7ec40656da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 1 Apr 2022 15:58:38 +0200 Subject: Always scroll when selecting most recently watched episode. --- c/episodelistview.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/c/episodelistview.c b/c/episodelistview.c index 76c99d9..5c9d8ba 100644 --- a/c/episodelistview.c +++ b/c/episodelistview.c @@ -117,20 +117,17 @@ ElvSelectRecent() term_t t; t = T(1); - P("track_episodes","most_recently_watched",1,t) { - iEpisode = 1; - goto sel; - } + iItem = 0; + P("track_episodes","most_recently_watched",1,t) goto s; GI(t,&iEpisode) return; -sel: lvfi.flags = LVFI_PARAM; + lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; iItem = ListView_FindItem(HElv, -1, &lvfi); if (iItem == -1) return; - if (iItem > 5) - ElvSetTop(iItem-5); +s: ElvSetTop(iItem > 5? iItem-5: 0); ListView_SetItemState(HElv, iItem, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED); LpLviElvSelection->iItem = iItem; -- cgit v1.2.3