aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-01 15:58:38 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-01 15:58:38 +0200
commitc214b8f1f04467aec61611b91913ee7ec40656da (patch)
tree9c247926681d3d2e8a9c1224f33de2c82a5f7311 /c
parent9a5055af82bdd281e334513e5318c636d63f53ee (diff)
downloadEpisodeBrowser-c214b8f1f04467aec61611b91913ee7ec40656da.tar.gz
Always scroll when selecting most recently watched episode.
Diffstat (limited to 'c')
-rw-r--r--c/episodelistview.c11
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;