diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index 76021aa0ae..b5e97de827 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -431,8 +431,15 @@ wxSize wxMSWButton::IncreaseToStdSizeAndCache(wxControl *btn, const wxSize& size // // Note that we intentionally don't use GetDefaultSize() here, because // it's inexact -- dialog units depend on this dialog's font. - const wxSize sizeDef = btn->ConvertDialogToPixels(btn->FromDIP(wxSize(50, 14))); - + wxSize sizeDef = btn->ConvertDialogToPixels(wxSize(50, 14)); + if ( btn->GetContentScaleFactor() > 1.0 ) + { + // At higher DPI, the returned height is too big compared to + // standard Windows buttons (like Save, Open, OK). FromDIP(25) + // matches the size of the buttons in standard Windows dialogs, see + // https://trac.wxwidgets.org/ticket/18528 for the discussion. + sizeDef.y = btn->FromDIP(25); + } sizeBtn.IncTo(sizeDef); } else // wxBU_EXACTFIT case diff --git a/src/msw/gauge.cpp b/src/msw/gauge.cpp index af7cefdee5..ac03441790 100644 --- a/src/msw/gauge.cpp +++ b/src/msw/gauge.cpp @@ -122,9 +122,9 @@ wxSize wxGauge::DoGetBestSize() const // the smaller one. if (HasFlag(wxGA_VERTICAL)) - return ConvertDialogToPixels(FromDIP(wxSize(8, 107))); + return ConvertDialogToPixels(wxSize(8, 107)); else - return ConvertDialogToPixels(FromDIP(wxSize(107, 8))); + return ConvertDialogToPixels(wxSize(107, 8)); } // ----------------------------------------------------------------------------