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
This commit is contained in:
Vadim Zeitlin 2011-12-21 13:56:50 +00:00
parent 7451b5c459
commit 08be21f56d

View File

@ -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;