honour wxBU_EXACTFIT in wxToggleButton (patch 1567892)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -80,6 +80,7 @@ wxMSW:
|
|||||||
- Fixed a bug whereby static controls didn't use the correct text colour if the
|
- Fixed a bug whereby static controls didn't use the correct text colour if the
|
||||||
parent's background colour had been set (most noticeable when switching to a
|
parent's background colour had been set (most noticeable when switching to a
|
||||||
high-contrast theme).
|
high-contrast theme).
|
||||||
|
- Respect wxBU_EXACTFIT style in wxToggleButton (Alexander Borovsky)
|
||||||
|
|
||||||
wxMac:
|
wxMac:
|
||||||
|
|
||||||
|
@@ -126,14 +126,18 @@ wxSize wxToggleButton::DoGetBestSize() const
|
|||||||
int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar);
|
int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar);
|
||||||
|
|
||||||
#if wxUSE_BUTTON
|
#if wxUSE_BUTTON
|
||||||
wxSize sz = wxButton::GetDefaultSize();
|
// make all buttons of at least standard size unless wxBU_EXACTFIT is given
|
||||||
if (wBtn > sz.x)
|
if ( !HasFlag(wxBU_EXACTFIT) )
|
||||||
sz.x = wBtn;
|
{
|
||||||
if (hBtn > sz.y)
|
const wxSize szMin = wxButton::GetDefaultSize();
|
||||||
sz.y = hBtn;
|
if ( wBtn < szMin.x )
|
||||||
#else
|
wBtn = szMin.x;
|
||||||
|
if ( hBtn < szMin.y )
|
||||||
|
hBtn = szMin.y;
|
||||||
|
}
|
||||||
|
#endif // wxUSE_BUTTON
|
||||||
|
|
||||||
wxSize sz(wBtn, hBtn);
|
wxSize sz(wBtn, hBtn);
|
||||||
#endif
|
|
||||||
|
|
||||||
CacheBestSize(sz);
|
CacheBestSize(sz);
|
||||||
return sz;
|
return sz;
|
||||||
|
Reference in New Issue
Block a user