]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct generic wxListCtrl display of items with icons in list mode.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 21 Dec 2011 13:56:50 +0000 (13:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 21 Dec 2011 13:56:50 +0000 (13:56 +0000)
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

index ddb6197f0799aba5648603484789f1da74010604..6f02e43f3a317a9e828e1b265346a8a81864fdb7 100644 (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;