aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-22 23:52:22 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-22 23:52:22 +0200
commit21e96c692595f204b91431a90123419e4a1780c4 (patch)
treefbd273dc24fa590626283dac09bc7671f0562d59 /c/episodelistview.cpp
parentc1bbba366067f27881195f74cee5d063d1b270b0 (diff)
downloadEpisodeBrowser-21e96c692595f204b91431a90123419e4a1780c4.tar.gz
Cache GetSystemMetrics values with variable template.
The variable template could be generalized like this: template <auto F, auto... A> const auto cache = F(A...); and instantiated like: cache<GetSystemMetrics, SM_CXVSCROLL> It would still be limited to constant function arguments, which usually isn't a problem for GetSystemMetrics, but might be for other functions.
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r--c/episodelistview.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp
index 6f12a0f..17ae373 100644
--- a/c/episodelistview.cpp
+++ b/c/episodelistview.cpp
@@ -143,14 +143,13 @@ void EpisodeListView::Redraw()
void EpisodeListView::ResizeColumns(RECT& rcParent)
{
- extern int g_cxVScroll;
ListView_SetColumnWidth(hWnd, ELVSIEPISODE, LVSCW_AUTOSIZE);
int cxColumn = ListView_GetColumnWidth(hWnd, ELVSIEPISODE)+4;
ListView_SetColumnWidth(hWnd, ELVSIEPISODE, cxColumn);
cxColumn += ListView_GetColumnWidth(hWnd, ELVSIRATING);
- ListView_SetColumnWidth(hWnd, ELVSITITLE, rcParent.right-cxColumn-g_cxVScroll-4);
+ ListView_SetColumnWidth(hWnd, ELVSITITLE, rcParent.right-cxColumn-Metric<SM_CXVSCROLL>-4);
}
/* Select previously focused episode. */