From 3a1a76a8be756c7cb26a11a297cc13d246346b20 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Aug 2006 14:17:26 +0000 Subject: [PATCH] update the item width when making it bold, otherwise the selection highlight was too small after an item was made bold (and too big after it was reset to normal) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 66822423d0..b0de2f9f2b 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1021,6 +1021,12 @@ void wxGenericTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold) if ( pItem->IsBold() != bold ) { pItem->SetBold(bold); + + // recalculate the item size as bold and non bold fonts have different + // widths + wxClientDC dc(this); + CalculateSize(pItem, dc); + RefreshLine(pItem); } }