X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c046274e38081407d9f229915e091b000f847010..40452e05839d958474a8be831632975035af3384:/src/msw/bmpbuttn.cpp diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index ee417d6608..535ac94e9c 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -466,7 +466,21 @@ wxSize wxBitmapButton::DoGetBestSize() const best.x = m_bmpNormal.GetWidth() + 2*m_marginX; best.y = m_bmpNormal.GetHeight() + 2*m_marginY; } + + // all buttons have at least the standard size unless the user explicitly + // wants them to be of smaller size and used wxBU_EXACTFIT style when + // creating the button + if ( !HasFlag(wxBU_EXACTFIT) ) + { + wxSize sz = GetDefaultSize(); + if (best.x > sz.x) + sz.x = best.x; + if (best.y > sz.y) + sz.y = best.y; + } + return best; } #endif // wxUSE_BMPBUTTON +