From 97f0a27ab0cbf605ba789be553c0df3bb44a6787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 23 Jul 2022 00:16:42 +0200 Subject: Improve UpdateLayout and ResizeColumns. This incidentally removes the need for the variable template introduced by 21e96c6. I'm sure it will be needed at some point, though. --- c/main.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'c/main.cpp') diff --git a/c/main.cpp b/c/main.cpp index c04890d..421e0ca 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -518,11 +518,16 @@ void UpdateLayout() SendMessage(g_pDlv->hWnd, WM_SETREDRAW, FALSE, 0); SendMessage(g_pElv->hWnd, WM_SETREDRAW, FALSE, 0); + /* If a modern theme is used, list view borders should be + * hidden. This variable governs that. (See how it is used in + * the arguments to SetWindowRect below.) */ + const long x = IsThemeActive(); + const long cyDlv = rrStatus.top-g_pDlv->Height(); - require(SetWindowRect(g_pDlv->hWnd, 0, cyDlv, rc.right, rrStatus.top)); - require(SetWindowRect(g_pElv->hWnd, 0, 0, rc.right, cyDlv+IsThemeActive())); - g_pDlv->ResizeColumns(rc); - g_pElv->ResizeColumns(rc); + require(SetWindowRect(g_pDlv->hWnd, -x, cyDlv, rc.right+x*2, rrStatus.top+x)); + require(SetWindowRect(g_pElv->hWnd, -x, -x*2, rc.right+x*2, cyDlv+x)); + g_pDlv->ResizeColumns(); + g_pElv->ResizeColumns(); SendMessage(g_pElv->hWnd, WM_SETREDRAW, TRUE, 0); SendMessage(g_pDlv->hWnd, WM_SETREDRAW, TRUE, 0); -- cgit v1.2.3