Always use default margins for wxBitmapButton under Mac

Previously this was only done when wxBU_AUTODRAW was specified, making
this the only place in wxWidgets where this style was actually used.

This was not ideal, as the same code, not using wxBU_AUTODRAW, worked
just fine under MSW and GTK, but created ugly-looking buttons under Mac,
so do the right thing by default and let people call SetMargins(0, 0) if
they really don't want to have any margins.

Closes #18170.
This commit is contained in:
Vadim Zeitlin 2018-07-21 14:38:31 +02:00
parent c4c4fb46d9
commit 5b703b6a24
2 changed files with 6 additions and 10 deletions

View File

@ -47,6 +47,10 @@ Changes in behaviour not resulting in compilation errors
event handlers if you want the standard key combinations such as Alt-Space or
Alt-F4 to work.
- wxOSX port uses default button margins for wxBitmapButton by default, for
consistency with the other ports. You now need to call SetMargins(0, 0)
explicitly if you really don't want to have any margins in your buttons.
Changes in behaviour which may result in build errors
-----------------------------------------------------

View File

@ -38,16 +38,8 @@ bool wxBitmapButton::Create( wxWindow *parent,
validator, name) )
return false;
if ( style & wxBU_AUTODRAW )
{
m_marginX =
m_marginY = wxDEFAULT_BUTTON_MARGIN;
}
else
{
m_marginX =
m_marginY = 0;
}
m_marginX =
m_marginY = wxDEFAULT_BUTTON_MARGIN;
m_bitmaps[State_Normal] = bitmap;