Skip to content

Commit

Permalink
Merge pull request #444 from lifenjoiner/text-col-expand
Browse files Browse the repository at this point in the history
fix matching text column does not expand when there is room
  • Loading branch information
stefankueng authored Feb 2, 2024
2 parents dba47cf + b523d60 commit 41ceae4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SearchDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4332,7 +4332,14 @@ void CSearchDlg::AutoSizeAllColumns()
RECT rc{};
ListView_GetItemRect(hListControl, 0, &rc, LVIR_BOUNDS);
auto itemWidth = rc.right - rc.left;
ListView_GetItemRect(hListControl, 0, &rc, LVIR_ICON);
if (nItemCount > 0)
{
GetClientRect(hListControl, &rc);
if (itemWidth < rc.right - rc.left)
{
itemWidth = rc.right - rc.left;
}
}
auto totalWidth = std::accumulate(colWidths.begin(), colWidths.end(), 0);
totalWidth -= colWidths[colWidths.size() - 2];
auto textWidth = itemWidth - totalWidth;
Expand Down

0 comments on commit 41ceae4

Please sign in to comment.