aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/datalistview.c2
-rw-r--r--c/defs.h4
-rw-r--r--c/episodelistview.c2
-rw-r--r--c/listview.c9
-rw-r--r--c/main.c4
5 files changed, 10 insertions, 11 deletions
diff --git a/c/datalistview.c b/c/datalistview.c
index efeb7d4..fe16913 100644
--- a/c/datalistview.c
+++ b/c/datalistview.c
@@ -13,7 +13,7 @@ DlvCreate()
{
LVCOLUMN lvc;
- HDlv = LvCreate((HMENU)IDC_DATALISTVIEW);
+ HDlv = LvCreate((HMENU)IDC_DATALISTVIEW, LVS_NOCOLUMNHEADER);
lvc.mask = LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM;
lvc.iSubItem = 0;
diff --git a/c/defs.h b/c/defs.h
index 6982578..606aa49 100644
--- a/c/defs.h
+++ b/c/defs.h
@@ -11,8 +11,8 @@ TCHAR *TszFromSz(const char *, int);
void UpdateLayout();
/* listview.c */
-HWND LvCreate(HMENU);
-int LvHeight(HWND);
+HWND LvCreate(HMENU, DWORD);
+int LvHeight(HWND, int);
/* episodelistview.c */
HWND ElvCreate();
diff --git a/c/episodelistview.c b/c/episodelistview.c
index 54c8b8c..0a85635 100644
--- a/c/episodelistview.c
+++ b/c/episodelistview.c
@@ -17,7 +17,7 @@ ElvCreate()
LpLviElvSelection = malloc(sizeof(LVITEM));
if (!LpLviElvSelection) return NULL;
- HElv = LvCreate((HMENU)IDC_EPISODELISTVIEW);
+ HElv = LvCreate((HMENU)IDC_EPISODELISTVIEW, 0);
lvc.mask = LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM;
lvc.iSubItem = 0;
diff --git a/c/listview.c b/c/listview.c
index e357905..868ab9e 100644
--- a/c/listview.c
+++ b/c/listview.c
@@ -11,7 +11,7 @@ WNDPROC LvPrevProc;
static LRESULT CALLBACK LvProc(HWND, UINT, WPARAM, LPARAM);
HWND
-LvCreate(HMENU hMenu)
+LvCreate(HMENU hMenu, DWORD dwStyle)
{
HWND hLv;
@@ -19,7 +19,7 @@ LvCreate(HMENU hMenu)
WS_EX_CLIENTEDGE,
WC_LISTVIEW,
TEXT(""),
- WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP
+ dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP
|LVS_REPORT|LVS_NOSORTHEADER|LVS_SHOWSELALWAYS,
0, 0, 0, 0,
HWnd, hMenu, GetModuleHandle(NULL), NULL
@@ -70,10 +70,9 @@ LvProc(HWND hLv, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* Naively calculate height of list view. */
int
-LvHeight(HWND hLv)
+LvHeight(HWND hLv, int bHeader)
{
int iCount;
iCount = ListView_GetItemCount(hLv);
- return iCount? Dpi(27)+iCount*Dpi(19): 0;
+ return iCount? Dpi(bHeader? 27: 3)+iCount*Dpi(19): 0;
}
-
diff --git a/c/main.c b/c/main.c
index eaca8f3..cf9818a 100644
--- a/c/main.c
+++ b/c/main.c
@@ -125,7 +125,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;
extern HWND HDlv;
- lpMMI->ptMinTrackSize.y = LvHeight(HDlv)+80;
+ lpMMI->ptMinTrackSize.y = LvHeight(HDlv, 0)+80;
break;
}
case WM_THEMECHANGED:
@@ -314,7 +314,7 @@ UpdateLayout()
/* Resize data list view. */
hDlv = GetDlgItem(HWnd, IDC_DATALISTVIEW);
- cyDlv = rc.bottom - LvHeight(hDlv);
+ cyDlv = rc.bottom - LvHeight(hDlv, 0);
MoveWindow(hDlv, 0, cyDlv, rc.right, rc.bottom, TRUE);
cxColumn = ListView_GetColumnWidth(hDlv, 0);