X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03e11df5470fd64d9d9a669d0b50b84c2d714736..3ce946d47ef03fcf330b0a28c0ff815ea480da55:/src/mac/carbon/button.cpp diff --git a/src/mac/carbon/button.cpp b/src/mac/carbon/button.cpp index 72e1af8e5d..c67c470acf 100644 --- a/src/mac/carbon/button.cpp +++ b/src/mac/carbon/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);