BColumnListView: Consider current, not preferred, column width for overall preferred with.
Otherwise, the entire list will be scanned for row widths, which
is extremely slow with thousands of items, and may not be what
the user wants anyway, if they have set specific column sizes
which are larger/smaller than that.
Helps with #16012 and #15889 considerably.
(cherry picked from commit 9585fabd612d4c823ed9f9d20b15c4c12411895a)
Change-Id: I7414c2f0f69b1d791adf9d8186dbf1ff95a126fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2688
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Diff
src/kits/interface/ColumnListView.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -1967,14 +1967,15 @@
size.width = titleRect.left - Bounds().left;
size.width += Bounds().right - titleRect.right;
size.width += fTitleView->MarginWidth();
for (int32 i = 0; i < count; i++) {
BColumn* column = ColumnAt(i);
if (column != NULL)
size.width += fOutlineView->GetColumnPreferredWidth(column);
size.width += column->Width();
}
}