From: Vadim Zeitlin Date: Mon, 14 Feb 2011 22:12:04 +0000 (+0000) Subject: Don't add margins for buttons with text and images by default in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c3d652aeb9db1ada2badcd616fbfcdf802bd9ec2 Don't add margins for buttons with text and images by default in wxMSW. For some reason wxXPButtonImageData added (big) margins around the button by default resulting in too much padding. Simply remove these margins to make it behave similarly to wxODButtonImageData. See #12924. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/button.cpp b/src/msw/button.cpp index cabac36506..6323ec0bc9 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -225,13 +225,13 @@ public: m_data.himl = GetHimagelistOf(&m_iml); - // use default margins + // no margins by default m_data.margin.left = - m_data.margin.right = btn->GetCharWidth(); + m_data.margin.right = m_data.margin.top = - m_data.margin.bottom = btn->GetCharHeight() / 2; + m_data.margin.bottom = 0; - // and default alignment + // use default alignment m_data.uAlign = BUTTON_IMAGELIST_ALIGN_LEFT; UpdateImageInfo();