diff options
Diffstat (limited to 'c')
-rw-r--r-- | c/common.c | 10 | ||||
-rw-r--r-- | c/defs.h | 1 | ||||
-rw-r--r-- | c/episodelistview.c | 33 |
3 files changed, 21 insertions, 23 deletions
@@ -47,13 +47,3 @@ TszFromSz(const char *sz, int iCp) return tsz; } - -int -Watched(int iEpisode) -{ - term_t t; - t = T(1); - PI(t,iEpisode) return 0; - P("track_episodes","watched",1,t) return 0; - return 1; -} @@ -7,7 +7,6 @@ /* common.c */ int Dpi(int); TCHAR *TszFromSz(const char *, int); -int Watched(int); /* main.c */ void UpdateLayout(); diff --git a/c/episodelistview.c b/c/episodelistview.c index 657b099..39b5c8a 100644 --- a/c/episodelistview.c +++ b/c/episodelistview.c @@ -6,10 +6,8 @@ #include "resource.h" #include "defs.h" -extern HFONT HfBold; -extern HWND HWnd; HWND HElv; -LPLVITEM LpLviElvSelection; +LPLVITEM LpLviElvSelection; /* Most recently selected episode. */ HWND ElvCreate() @@ -47,15 +45,15 @@ ElvHandleNotify(LPARAM lParam) switch (lpNmLv->hdr.code) { case LVN_ITEMCHANGED: - if ((lpNmLv->uChanged & LVIF_STATE) - && (lpNmLv->uNewState & LVIS_FOCUSED)) { + if ((lpNmLv->uChanged & LVIF_STATE) && + (lpNmLv->uNewState & LVIS_FOCUSED)) { LpLviElvSelection->iItem = lpNmLv->iItem; LpLviElvSelection->lParam = lpNmLv->lParam; ElvUpdateName(LpLviElvSelection); DlvShowEpisode(lpNmLv->lParam); } break; - case NM_CUSTOMDRAW: + case NM_CUSTOMDRAW: /* Make unwatched episodes bold. */ { LPNMLVCUSTOMDRAW lpLvCd; lpLvCd = (LPNMLVCUSTOMDRAW)lParam; @@ -64,23 +62,33 @@ ElvHandleNotify(LPARAM lParam) return CDRF_NOTIFYITEMDRAW; break; case CDDS_ITEMPREPAINT: - if (!Watched(lpLvCd->nmcd.lItemlParam)) { + { + term_t t; + extern HFONT HfBold; + t = T(1); + PI(t,lpLvCd->nmcd.lItemlParam) break; + P("track_episodes","watched",1,t) { SelectObject(lpLvCd->nmcd.hdc, HfBold); return CDRF_NEWFONT; } break; + } } break; } - case NM_DBLCLK: - case NM_RETURN: + case NM_DBLCLK: /* Open clicked episode. */ + { + term_t t; + t = T(1); + PI(t,LpLviElvSelection->lParam) break; + P("local_episodes","open_episode",1,t); + break; + } + case NM_RETURN: /* Open all selected episodes. */ { LVITEM lvi; term_t t; extern HWND HElv; - - /* Open all selected episodes. */ - lvi.mask = LVIF_PARAM; lvi.iItem = -1; t = T(1); @@ -95,6 +103,7 @@ ElvHandleNotify(LPARAM lParam) case NM_RCLICK: { DWORD dwPos; + extern HWND HWnd; extern HMENU HPopupMenu; dwPos = GetMessagePos(); TrackPopupMenu(HPopupMenu, TPM_RIGHTBUTTON, |