]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed wxGauge's best size to conform to Windows HIG.
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 10 Feb 2010 13:31:58 +0000 (13:31 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 10 Feb 2010 13:31:58 +0000 (13:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/gauge.cpp

index 1045bffc6159173e493d9186b9d825fe9b06dbbc..1fcc481c80514535790163230f8fa38d4d8c07e0 100644 (file)
@@ -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));
 }
 
 // ----------------------------------------------------------------------------