Fix sizing wxBitmapButton used as wxPropertyGrid editor button

Since wxBitmapButton doesn't rescale embedded bitmap we need
to do this on our own to display entire bitmap even the button
is small.

Closes #18715.
This commit is contained in:
Artur Wieczorek
2020-04-10 20:33:16 +02:00
parent c7aeba7ed5
commit f95d6463d3
2 changed files with 50 additions and 6 deletions

View File

@@ -1331,9 +1331,7 @@ void wxPropertyGrid::CalculateFontAndBitmapStuff( int vspacing )
GetTextExtent(wxS("jG"), &x, &y, 0, 0, &m_captionFont);
m_lineHeight = m_fontHeight+(2*m_spacingy)+1;
#if defined(__WXGTK3__)
m_lineHeight = wxMax(35, m_lineHeight);
#endif
// button spacing
m_buttonSpacingY = (m_lineHeight - m_iconHeight) / 2;
if ( m_buttonSpacingY < 0 ) m_buttonSpacingY = 0;