Author: calberto
Date: 2007-09-18 04:36:12 -0400 (Tue, 18 Sep 2007)
New Revision: 85954

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
Log:
        * ListView.cs: max_label_wrapping is now 30 pixels instead of 38,
        as this is apparently the actual value used by .Net. Also apply
        ItemPadding in Details view only, and decrease the general width 
padding,
        to have only the needed. This should fix #324340 in Windows too.

2007-09-18  Carlos Alberto Cortez <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-18 08:26:46 UTC (rev 85953)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-18 08:36:12 UTC (rev 85954)
@@ -1,5 +1,12 @@
 2007-09-18  Carlos Alberto Cortez <[EMAIL PROTECTED]>
 
+       * ListView.cs: max_label_wrapping is now 30 pixels instead of 38,
+       as this is apparently the actual value used by .Net. Also apply
+       ItemPadding in Details view only, and decrease the general width 
padding,
+       to have only the needed. This should fix #324340 in Windows too.
+
+2007-09-18  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
        * ListViewItem.cs: Don't Invalidate item if parent is inside
        a BeginUpdate/EndUpdate block. This prevents to have differences
        between the ListView and items state, as well as avoid some exceptions

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-09-18 08:26:46 UTC (rev 85953)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-09-18 08:36:12 UTC (rev 85954)
@@ -1157,14 +1157,14 @@
                        }
 #endif
 
-                       // adjustment for space
-                       if (!ret_size.IsEmpty)
+                       // adjustment for space in Details view
+                       if (!ret_size.IsEmpty && view == View.Details)
                                ret_size.Width += 
ThemeEngine.Current.ListViewItemPaddingWidth;
 
                        return ret_size;
                }
 
-               const int max_wrap_padding = 38;
+               const int max_wrap_padding = 30;
 
                // Sets the size of the biggest item text as per the view
                private void CalcTextSize ()
@@ -1207,7 +1207,7 @@
                                text_size.Width = this.Width;
 
                        // little adjustment
-                       text_size.Width += 4;
+                       text_size.Width += 2;
                        text_size.Height += 2;
                }
 
@@ -1426,8 +1426,12 @@
                        get {
                                int image_w = LargeImageList == null ? 12 : 
LargeImageList.ImageSize.Width;
                                int image_h = LargeImageList == null ? 2 : 
LargeImageList.ImageSize.Height;
-                               int w = CheckBoxSize.Width + 2 + Math.Max 
(text_size.Width, image_w);
                                int h = text_size.Height + 2 + Math.Max 
(CheckBoxSize.Height, image_h);
+                               int w = Math.Max (text_size.Width, image_w);
+
+                               if (check_boxes)
+                                       w += 2 + CheckBoxSize.Width;
+
                                return new Size (w, h);
                        }
                }
@@ -1436,8 +1440,12 @@
                        get {
                                int image_w = SmallImageList == null ? 0 : 
SmallImageList.ImageSize.Width;
                                int image_h = SmallImageList == null ? 0 : 
SmallImageList.ImageSize.Height;
-                               int w = text_size.Width + 2 + 
CheckBoxSize.Width + image_w;
                                int h = Math.Max (text_size.Height, Math.Max 
(CheckBoxSize.Height, image_h));
+                               int w = text_size.Width + image_w;
+
+                               if (check_boxes)
+                                       w += 2 + CheckBoxSize.Width;
+
                                return new Size (w, h);
                        }
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to