From: Benjamin Williams Date: Thu, 16 Apr 2009 13:02:48 +0000 (+0000) Subject: implement default width for toolbar labels X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e54e92e681b48a58207ef5e2ad6f8d51ebd62f87 implement default width for toolbar labels git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 3fe31d4b0c..d356d353a2 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -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); }