From 34c0940e6cd6d222f2234d81433fef38ca3a3738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 6 Apr 2022 23:06:56 +0200 Subject: Persist "View Watched" setting. --- c/main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'c/main.c') diff --git a/c/main.c b/c/main.c index fcb8d81..cbc3167 100644 --- a/c/main.c +++ b/c/main.c @@ -110,6 +110,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { HMODULE hModule; FARPROC GetDpiForWindow; + term_t t; extern HWND HWnd, HElv; HWnd = hWnd; IDPI = 96; @@ -119,7 +120,11 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) FreeLibrary(hModule); } SetWindowPos(hWnd, NULL, -1, -1, Dpi(510), Dpi(400), SWP_NOMOVE); - SetupFonts(); + t = T(1); + P("cfg","get_view_watched",1,t) goto s; + GI(t,&BViewWatched); + CheckMenuItem(GetMenu(hWnd), ID_VIEW_WATCHED, BViewWatched? MF_CHECKED: MF_UNCHECKED); + s: SetupFonts(); DlvCreate(); ElvCreate(); UpdateTheme(); @@ -201,11 +206,13 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case ID_VIEW_WATCHED: { - HMENU hMenu; - hMenu = GetMenu(hWnd); - CheckMenuItem(hMenu, ID_VIEW_WATCHED, BViewWatched? MF_UNCHECKED: MF_CHECKED); + term_t t; + CheckMenuItem(GetMenu(hWnd), ID_VIEW_WATCHED, BViewWatched? MF_UNCHECKED: MF_CHECKED); BViewWatched = !BViewWatched; ElvUpdate(); + t = T(1); + PI(t,BViewWatched) break; + P("cfg","set_view_watched",1,t); break; } case ID_WATCH: -- cgit v1.2.3