]> git.saurik.com Git - wxWidgets.git/commitdiff
Restore height tweaking in wxMSWButton::GetFittingSize().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:47:48 +0000 (12:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:47:48 +0000 (12:47 +0000)
The change of r66893 was wrong, we do need to adjust the button height here
because the increase to standard height is not enough if we use bigger fonts
that require making taller buttons.

The real problem was the use of EDIT_HEIGHT_FROM_CHAR_HEIGHT() which added too
much to the height, so replace it with something based on the actual font
height. This is still arbitrary but slightly better.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/button.cpp

index 4eea5a4c5abc015dfebfd0aeba4a719985d6d726..75d983e98d605db2c72d60e9771156644acad865 100644 (file)
@@ -388,6 +388,7 @@ wxSize wxMSWButton::GetFittingSize(wxWindow *win,
     wxSize sizeBtn = sizeLabel;
 
     sizeBtn.x += 3*win->GetCharWidth();
+    sizeBtn.y += win->GetCharHeight()/2;
 
     // account for the shield UAC icon if we have it
     if ( flags & Size_AuthNeeded )