2007-01-10 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Wed, 10 Jan 2007 20:16:55 +0000 (20:16 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Wed, 10 Jan 2007 20:16:55 +0000 (20:16 -0000)
* ListView.cs: Add more text padding space when using
auto resize for columns (the previous value didn't work fine).

* ThemeWin32Classic.cs: Update text position inside columns,
to match the appeareance of .Net.

* ColumnHeader.cs: When using auto resize, only the Width should
depend on the sub items, not the Height. Also, set width after
auto resizing (the value of Width should never remain as -1 or -2).

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

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

index 2f5a759a29ed79874153118264b87a21a71d7867..064fe64b4fe5aca7324b7ef1a261719a68072a4d 100644 (file)
@@ -1,3 +1,15 @@
+2007-01-10  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * ListView.cs: Add more text padding space when using
+       auto resize for columns (the previous value didn't work fine).
+
+       * ThemeWin32Classic.cs: Update text position inside columns,
+       to match the appeareance of .Net.
+
+       * ColumnHeader.cs: When using auto resize, only the Width should
+       depend on the sub items, not the Height. Also, set width after
+       auto resizing (the value of Width should never remain as -1 or -2).
+
 2007-01-10  Chris Toshok  <toshok@ximian.com>
 
        * Application.cs: fix compilation errors when debug is enabled.
index 42d49d8e0635a009ffaa15113726272e16c5069d..5644f363bc9d2c6a3dba00645ff16dfb050ff0b4 100644 (file)
@@ -145,17 +145,18 @@ namespace System.Windows.Forms
                        // text is wrappable only in LargeIcon and SmallIcon views
                        format.FormatFlags = StringFormatFlags.NoWrap;
 
-                       if (width >= 0) {
-                               column_rect.Width = width;
-                               if (owner != null)
-                                       column_rect.Height = owner.Font.Height + 5 ;
-                               else
-                                       column_rect.Height = ThemeEngine.Current.DefaultFont.Height + 5;
-                       }
-                       else if (Index != -1)
-                               column_rect.Size = owner.GetChildColumnSize (Index);
+                       if (owner != null)
+                               column_rect.Height = owner.Font.Height + 8;
                        else
-                               column_rect.Size = Size.Empty;
+                               column_rect.Height = ThemeEngine.Current.DefaultFont.Height + 8;
+
+                       if (width >= 0)
+                               column_rect.Width = width;
+                       else if (Index != -1) {
+                               column_rect.Width = owner.GetChildColumnSize (Index).Width;
+                               width = column_rect.Width;
+                       } else
+                               column_rect.Width = 0;
                }
 
                internal void SetListView (ListView list_view)
index 60c76b9b70537e8dc240d9a653a2fc4d91236a76..ab2710054d4a16193aa2ca78dcc719325ff1313c 100644 (file)
@@ -760,7 +760,7 @@ namespace System.Windows.Forms
                        Refresh ();
                }
 
-               const int text_padding = 5;
+               const int text_padding = 15;
 
                internal Size GetChildColumnSize (int index)
                {
index 591ab8ee6f33a65a56871b057670882d39bc4811..463bd7ecf56a9aef6fb02dacd7f2e7cce92fa439 100644 (file)
@@ -1754,10 +1754,11 @@ namespace System.Windows.Forms
                                                else
                                                        state = ButtonState.Flat;
                                                this.CPDrawButton (dc, rect, state);
-                                               rect.X += 3;
-                                               rect.Width -= 8;
+                                               rect.X += 8;
+                                               rect.Width -= 13;
                                                if (rect.Width <= 0)
                                                        continue;
+
                                                dc.DrawString (col.Text, DefaultFont,
                                                               SystemBrushes.ControlText,
                                                               rect, col.Format);