From 08be21f56d5f60eddbd41c89f6dfe1a414a79f6e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 21 Dec 2011 13:56:50 +0000 Subject: [PATCH] Correct generic wxListCtrl display of items with icons in list mode. The changes of r70066 improved the layout for icon and small icon modes but broke it for the list mode if items had icons because the item width should account for the icon as well in this case. Simply disable the code added in this revision when in list mode, we don't need to do anything then anyhow as the layout already worked correctly for it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index ddb6197f07..6f02e43f3a 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -3660,11 +3660,15 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh) || i == count - 1) { // Adjust all items in this row to have the same - // width to ensure that they all align horizontally. - size_t firstRowLine = i - currentlyVisibleLines + 1; - for (size_t j = firstRowLine; j <= i; j++) + // width to ensure that they all align horizontally in + // icon view. + if ( HasFlag(wxLC_ICON) || HasFlag(wxLC_SMALL_ICON) ) { - GetLine(j)->m_gi->ExtendWidth(maxWidthInThisRow); + size_t firstRowLine = i - currentlyVisibleLines + 1; + for (size_t j = firstRowLine; j <= i; j++) + { + GetLine(j)->m_gi->ExtendWidth(maxWidthInThisRow); + } } currentlyVisibleLines = 0;