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
This commit is contained in:
parent
de83bbe34f
commit
051b7b264f
@ -4027,6 +4027,19 @@ void wxListMainWindow::InsertItem( wxListItem &item )
|
|||||||
wxListLineData *line = new wxListLineData(this);
|
wxListLineData *line = new wxListLineData(this);
|
||||||
|
|
||||||
line->SetItem( item.m_col, item );
|
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 );
|
m_lines.Insert( line, id );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user