aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.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/episodelistview.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/episodelistview.cpp')
-rw-r--r--c/episodelistview.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp
index 17ae373..cdb3dc7 100644
--- a/c/episodelistview.cpp
+++ b/c/episodelistview.cpp
@@ -141,15 +141,16 @@ void EpisodeListView::Redraw()
RDW_ERASE|RDW_FRAME|RDW_INVALIDATE|RDW_ALLCHILDREN);
}
-void EpisodeListView::ResizeColumns(RECT& rcParent)
+void EpisodeListView::ResizeColumns()
{
- ListView_SetColumnWidth(hWnd, ELVSIEPISODE, LVSCW_AUTOSIZE);
+ RECT rc;
+ require(GetClientRect(hWnd, &rc));
+ 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-Metric<SM_CXVSCROLL>-4);
+ ListView_SetColumnWidth(hWnd, ELVSITITLE, rc.right-cxColumn);
}
/* Select previously focused episode. */