X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03e11df5470fd64d9d9a669d0b50b84c2d714736..9082f1a970e72765544a23b6f0b3481011ddca15:/src/mac/button.cpp?ds=inline diff --git a/src/mac/button.cpp b/src/mac/button.cpp index 72e1af8e5d..c67c470acf 100644 --- a/src/mac/button.cpp +++ b/src/mac/button.cpp @@ -85,18 +85,20 @@ void wxButton::SetDefault() wxSize wxButton::DoGetBestSize() const { + wxSize sz = GetDefaultSize() ; + int wBtn = m_label.Length() * 8 + 12 ; int hBtn = 20 ; - if ( wBtn < 80 ) - wBtn = 80 ; - - return wxSize(wBtn, hBtn); + if (wBtn > sz.x) sz.x = wBtn; + if (hBtn > sz.y) sz.y = hBtn; + + return sz ; } wxSize wxButton::GetDefaultSize() { - int wBtn = 80 /* + 2 * m_macHorizontalBorder */ ; + int wBtn = 70 /* + 2 * m_macHorizontalBorder */ ; int hBtn = 20 /* + 2 * m_macVerticalBorder */ ; return wxSize(wBtn, hBtn);