diff options
author | John Ankarström <john@ankarstrom.se> | 2022-04-01 15:58:38 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-04-01 15:58:38 +0200 |
commit | c214b8f1f04467aec61611b91913ee7ec40656da (patch) | |
tree | 9c247926681d3d2e8a9c1224f33de2c82a5f7311 | |
parent | 9a5055af82bdd281e334513e5318c636d63f53ee (diff) | |
download | EpisodeBrowser-c214b8f1f04467aec61611b91913ee7ec40656da.tar.gz |
Always scroll when selecting most recently watched episode.
-rw-r--r-- | c/episodelistview.c | 11 |
1 files 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; |