]> git.saurik.com Git - wxWidgets.git/commitdiff
implement default width for toolbar labels
authorBenjamin Williams <bwilliams@kirix.com>
Thu, 16 Apr 2009 13:02:48 +0000 (13:02 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Thu, 16 Apr 2009 13:02:48 +0000 (13:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibar.cpp

index 3fe31d4b0c109ff2ab4e3fd01318c2b7ade83b54..d356d353a208ebc5038f098bcf7302eace75db4e 100644 (file)
@@ -554,7 +554,13 @@ wxSize wxAuiDefaultToolBarArt::GetLabelSize(
 
     // get item's width
     width = item.GetMinSize().GetWidth();
-
+    
+    if (width == -1)
+    {
+        // no width specified, measure the text ourselves
+        width = dc.GetTextExtent(item.GetLabel()).GetX();
+    }
+    
     return wxSize(width, height);
 }