From 561ee240477e348efcd3670a5481ccb538d6724b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 20 Jul 2022 21:27:30 +0200 Subject: Simplify UpdateLayout. --- c/episodelistview.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'c/episodelistview.cpp') diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index 676f375..6f12a0f 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -141,6 +141,18 @@ void EpisodeListView::Redraw() RDW_ERASE|RDW_FRAME|RDW_INVALIDATE|RDW_ALLCHILDREN); } +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); +} + /* Select previously focused episode. */ void EpisodeListView::RestoreFocus() { -- cgit v1.2.3