Determine wxButton size correctly in wxMSW.
Instead of using default size for default GUI font, use the default font for this dialog's current font. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63250 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -457,7 +457,10 @@ wxSize wxMSWButton::ComputeBestSize(wxControl *btn)
|
|||||||
// creating the button
|
// creating the button
|
||||||
if ( !btn->HasFlag(wxBU_EXACTFIT) )
|
if ( !btn->HasFlag(wxBU_EXACTFIT) )
|
||||||
{
|
{
|
||||||
wxSize sizeDef = wxButton::GetDefaultSize();
|
// The size of a standard button in the dialog units is 50x14, use it.
|
||||||
|
// Note that we intentionally don't use GetDefaultSize() here, because
|
||||||
|
// it's inexact -- dialog units depend on this dialog's font.
|
||||||
|
wxSize sizeDef = btn->ConvertDialogToPixels(wxSize(50, 14));
|
||||||
if ( sizeBtn.x < sizeDef.x )
|
if ( sizeBtn.x < sizeDef.x )
|
||||||
sizeBtn.x = sizeDef.x;
|
sizeBtn.x = sizeDef.x;
|
||||||
if ( sizeBtn.y < sizeDef.y )
|
if ( sizeBtn.y < sizeDef.y )
|
||||||
|
Reference in New Issue
Block a user