From 051b7b264fd113b531097e5b762ccf850609e657 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 26 Apr 2011 22:57:12 +0000 Subject: [PATCH] Update line height in generic wxListCtrl to match images height. The height of the items of the generic wxListCtrl remained too small if an image of a greater than standard size was used. Fix this by forcing the line height recalculation when adding an item using an image higher than the current line height. Closes #12806. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 0c877f3b0c..bcf799a00b 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4027,6 +4027,19 @@ void wxListMainWindow::InsertItem( wxListItem &item ) wxListLineData *line = new wxListLineData(this); line->SetItem( item.m_col, item ); + if ( item.m_mask & wxLIST_MASK_IMAGE ) + { + // Reset the buffered height if it's not big enough for the new image. + if (m_small_image_list) + { + int imageWidth, imageHeight; + m_small_image_list->GetSize(item.GetImage(), + imageWidth, imageHeight); + + if ( imageHeight > m_lineHeight ) + m_lineHeight = 0; + } + } m_lines.Insert( line, id ); -- 2.45.2