aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.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/datalistview.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/datalistview.cpp')
-rw-r--r--c/datalistview.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 9ff4659..b728fa8 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -29,13 +29,15 @@ DataListView::DataListView(const HWND hWndParent)
ListView_InsertColumn(hWnd, DLVSIVALUE, &lvc);
}
-void DataListView::ResizeColumns(RECT& rcParent)
+void DataListView::ResizeColumns()
{
- ListView_SetColumnWidth(hWnd, DLVSIKEY, LVSCW_AUTOSIZE);
+ RECT rc;
+ require(GetClientRect(hWnd, &rc));
+ ListView_SetColumnWidth(hWnd, DLVSIKEY, LVSCW_AUTOSIZE);
const int cxColumn = ListView_GetColumnWidth(hWnd, 0)+4;
ListView_SetColumnWidth(hWnd, DLVSIKEY, cxColumn);
- ListView_SetColumnWidth(hWnd, DLVSIVALUE, rcParent.right-cxColumn-Metric<SM_CXVSCROLL>-4);
+ ListView_SetColumnWidth(hWnd, DLVSIVALUE, rc.right-cxColumn);
}
void DataListView::ShowEpisode(const int iEpisode)