diff options
Diffstat (limited to 'c/main.c')
-rw-r--r-- | c/main.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -88,7 +88,7 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PostQuitMessage(0); break; case WM_SIZE: - UpdateLayout(hWnd); + UpdateLayout(); break; case WM_CREATE: HWnd = hWnd; @@ -244,22 +244,24 @@ SetupFonts() /***/ void -UpdateLayout(HWND hWnd) +UpdateLayout() { HWND hElv, hDlv; - int cxColumn, cyDlv; + int cxColumn, cyDlv, iCount; + LOGFONT lf; RECT rc; static int cxVScroll = 0; if (cxVScroll == 0) cxVScroll = GetSystemMetrics(SM_CXVSCROLL); - GetClientRect(hWnd, &rc); + GetClientRect(HWnd, &rc); /* Resize data list view. */ - hDlv = GetDlgItem(hWnd, IDC_DATALISTVIEW); - cyDlv = rc.bottom-100; + hDlv = GetDlgItem(HWnd, IDC_DATALISTVIEW); + iCount = ListView_GetItemCount(hDlv); + cyDlv = rc.bottom - (iCount ? 27+iCount*19 : 0); MoveWindow(hDlv, 0, cyDlv, rc.right, rc.bottom, TRUE); cxColumn = ListView_GetColumnWidth(hDlv, 0); @@ -268,7 +270,7 @@ UpdateLayout(HWND hWnd) /* Resize episode list view. */ - hElv = GetDlgItem(hWnd, IDC_EPISODELISTVIEW); + hElv = GetDlgItem(HWnd, IDC_EPISODELISTVIEW); MoveWindow(hElv, 0, 0, rc.right, cyDlv+1, TRUE); cxColumn = ListView_GetColumnWidth(hElv, 0); |