]> git.saurik.com Git - wxWidgets.git/commitdiff
applied patch for calculating the tree items size with non default font (patch 520965)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Feb 2002 15:09:13 +0000 (15:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Feb 2002 15:09:13 +0000 (15:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 833404dd9f71f8786c68238ddac93092aa551443..590ca0211351b378cc757dd1eda60843920b4dd5 100644 (file)
@@ -2896,7 +2896,10 @@ void wxGenericTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc )
     wxCoord text_w = 0;
     wxCoord text_h = 0;
 
     wxCoord text_w = 0;
     wxCoord text_h = 0;
 
-    if (item->IsBold())
+    wxTreeItemAttr *attr = item->GetAttributes();
+    if ( attr && attr->HasFont() )
+        dc.SetFont(attr->GetFont());
+    else if ( item->IsBold() )
         dc.SetFont(m_boldFont);
 
     dc.GetTextExtent( item->GetText(), &text_w, &text_h );
         dc.SetFont(m_boldFont);
 
     dc.GetTextExtent( item->GetText(), &text_w, &text_h );