aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-23 00:16:42 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-23 00:16:42 +0200
commit97f0a27ab0cbf605ba789be553c0df3bb44a6787 (patch)
tree78d2c78343b43a8dcaab8df627af578ba9574b37 /c/main.cpp
parent21e96c692595f204b91431a90123419e4a1780c4 (diff)
downloadEpisodeBrowser-97f0a27ab0cbf605ba789be553c0df3bb44a6787.tar.gz
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.
Diffstat (limited to 'c/main.cpp')
-rw-r--r--c/main.cpp13
1 files changed, 9 insertions, 4 deletions
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);