From: Václav Slavík Date: Wed, 10 Feb 2010 13:31:58 +0000 (+0000) Subject: Fixed wxGauge's best size to conform to Windows HIG. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a2837c3c43e63d096c80141e4593a81236ec967c Fixed wxGauge's best size to conform to Windows HIG. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/gauge.cpp b/src/msw/gauge.cpp index 1045bffc61..1fcc481c80 100644 --- a/src/msw/gauge.cpp +++ b/src/msw/gauge.cpp @@ -177,12 +177,14 @@ WXDWORD wxGauge::MSWGetStyle(long style, WXDWORD *exstyle) const wxSize wxGauge::DoGetBestSize() const { - // VZ: no idea where does 28 come from, it was there before my changes and - // as nobody ever complained I guess we can leave it... + // Windows HIG (http://msdn.microsoft.com/en-us/library/aa511279.aspx) + // suggest progress bar size of "107 or 237 x 8 dialog units". Let's use + // the smaller one. + if (HasFlag(wxGA_VERTICAL)) - return wxSize(28, 100); + return ConvertDialogToPixels(wxSize(8, 107)); else - return wxSize(100, 28); + return ConvertDialogToPixels(wxSize(107, 8)); } // ----------------------------------------------------------------------------