From d63c9ecf46b4ae78b111c30f7dde1995c3869fcc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 7 Mar 2007 22:30:14 +0000 Subject: [PATCH] take images and margins into account when setting column width to wxLIST_AUTOSIZE_USEHEADER (patch 1664598) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44652 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 7fd022e786..97c78dfd42 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -3704,6 +3704,19 @@ void wxListMainWindow::SetColumnWidth( int col, int width ) if (width == wxLIST_AUTOSIZE_USEHEADER) { width = GetTextLength(column->GetText()); + width += 2*EXTRA_WIDTH; + + // check for column header's image availability + const int image = column->GetImage(); + if ( image != -1 ) + { + if ( m_small_image_list ) + { + int ix = 0, iy = 0; + m_small_image_list->GetSize(image, ix, iy); + width += ix + HEADER_IMAGE_MARGIN_IN_REPORT_MODE; + } + } } else if ( width == wxLIST_AUTOSIZE ) { -- 2.45.2