2007-05-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Fri, 18 May 2007 20:39:24 +0000 (20:39 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Fri, 18 May 2007 20:39:24 +0000 (20:39 -0000)
* ThemeWin32Classic.cs: Draw the check marks in ListViewItems
in the center of the checkbox, not in the left-top corner.
Fixes #80037.

svn path=/trunk/mcs/; revision=77665

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index c0e1bef9c7502000dd798d9d2c654e4d645e3a97..3fb89880b74fe0a695aa410da80bd2b8cbcfaeee 100644 (file)
@@ -1,3 +1,9 @@
+2007-05-18  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * ThemeWin32Classic.cs: Draw the check marks in ListViewItems
+       in the center of the checkbox, not in the left-top corner. 
+       Fixes #80037.
+
 2007-05-18  Jackson Harper  <jackson@ximian.com>
 
        * RichTextBox.cs: Recalculate the document after the scrollbars
index 20c0ae67fc3ff4855842bbea5b254ba3cb639a76..be62bc6f707b27af3395c2baf0e9c0f28a2116de 100644 (file)
@@ -2362,16 +2362,18 @@ namespace System.Windows.Forms
                                                // adjustments to get the check-mark at the right place
                                                rect.X ++; rect.Y ++;
                                                // following logic is taken from DrawFrameControl method
+                                               int x_offset = rect.Width / 5;
+                                               int y_offset = rect.Height / 3;
                                                for (int i = 0; i < check_wd; i++) {
-                                                       dc.DrawLine (check_pen, rect.Left + check_wd / 2,
-                                                                    rect.Top + check_wd + i,
-                                                                    rect.Left + check_wd / 2 + 2 * scale,
-                                                                    rect.Top + check_wd + 2 * scale + i);
+                                                       dc.DrawLine (check_pen, rect.Left + x_offset,
+                                                                    rect.Top + y_offset + i,
+                                                                    rect.Left + x_offset + 2 * scale,
+                                                                    rect.Top + y_offset + 2 * scale + i);
                                                        dc.DrawLine (check_pen,
-                                                                    rect.Left + check_wd / 2 + 2 * scale,
-                                                                    rect.Top + check_wd + 2 * scale + i,
-                                                                    rect.Left + check_wd / 2 + 6 * scale,
-                                                                    rect.Top + check_wd - 2 * scale + i);
+                                                                    rect.Left + x_offset + 2 * scale,
+                                                                    rect.Top + y_offset + 2 * scale + i,
+                                                                    rect.Left + x_offset + 6 * scale,
+                                                                    rect.Top + y_offset - 2 * scale + i);
                                                }
                                        }
                                }