aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-18 00:12:06 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-18 00:12:06 +0200
commit16902bf221c9fac58218ca50c479f93a3e01943d (patch)
tree8c3b66747f16ce78c07ba30c665c16c9d91b5458
parent2d83bf905a8da36a03d02ec83847741d553a7289 (diff)
downloadEpisodeBrowser-16902bf221c9fac58218ca50c479f93a3e01943d.tar.gz
Ensure focused item is visible after filter update.
-rw-r--r--c/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/c/main.c b/c/main.c
index be42cfc..eb60249 100644
--- a/c/main.c
+++ b/c/main.c
@@ -222,7 +222,9 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
case IDM_VIEW_WATCHED:
{
+ int iEpFocus;
term_t t;
+ extern HWND HElv;
CheckMenuItem(GetMenu(hWnd), IDM_VIEW_WATCHED,
BViewWatched? MF_UNCHECKED: MF_CHECKED);
BViewWatched = !BViewWatched;
@@ -230,11 +232,16 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
t = T(1);
PI(t,BViewWatched) break;
P("cfg","set_view_watched",1,t);
+ iEpFocus = ListView_GetNextItem(HElv, -1, LVNI_FOCUSED);
+ if (iEpFocus == -1) break;
+ ListView_EnsureVisible(HElv, iEpFocus, TRUE);
break;
}
case IDM_VIEW_TV_ORIGINAL:
{
+ int iEpFocus;
term_t t;
+ extern HWND HElv;
CheckMenuItem(GetMenu(hWnd), IDM_VIEW_TV_ORIGINAL,
BViewTVOriginal? MF_UNCHECKED: MF_CHECKED);
BViewTVOriginal = !BViewTVOriginal;
@@ -242,6 +249,9 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
t = T(1);
PI(t,BViewTVOriginal) break;
P("cfg","set_view_tv_original",1,t);
+ iEpFocus = ListView_GetNextItem(HElv, -1, LVNI_FOCUSED);
+ if (iEpFocus == -1) break;
+ ListView_EnsureVisible(HElv, iEpFocus, TRUE);
break;
}
case IDM_WATCH: